Dotclear

Changeset 3770:75566f4ffead


Ignore:
Timestamp:
07/10/18 13:41:19 (7 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Add a dark mode (user preferences), some refinements to come

Files:
3 added
12 edited

Legend:

Unmodified
Added
Removed
  • admin/_charte.php

    r3731 r3770  
    1111 
    1212dcPage::check('usage,contentadmin'); 
     13$core->auth->user_prefs->addWorkspace('interface'); 
    1314?> 
    1415<!DOCTYPE html> 
     
    2122    <title>Bibliothèque de styles - Dotclear - 2.7</title> 
    2223    <link rel="icon" type="image/png" href="images/favicon96-login.png" /> 
    23     <link rel="stylesheet" href="style/default.css" type="text/css" media="screen" /> 
    24     <?php 
    25 $core->auth->user_prefs->addWorkspace('interface'); 
     24<?php 
     25if ($core->auth->user_prefs->interface->dark_mode) { 
     26    echo dcPage::cssLoad('style/default-dark.css'); 
     27} else { 
     28    echo dcPage::cssLoad('style/default.css'); 
     29} 
    2630if ($core->auth->user_prefs->interface->htmlfontsize) { 
    2731    echo 
  • admin/preferences.php

    r3731 r3770  
    4141 
    4242$core->auth->user_prefs->addWorkspace('interface'); 
     43$user_ui_darkmode         = $core->auth->user_prefs->interface->darkmode; 
    4344$user_ui_enhanceduploader = $core->auth->user_prefs->interface->enhanceduploader; 
    4445$user_ui_hidemoreinfo     = $core->auth->user_prefs->interface->hidemoreinfo; 
     
    237238        # Update user prefs 
    238239        $core->auth->user_prefs->accessibility->put('nodragdrop', !empty($_POST['user_acc_nodragdrop']), 'boolean'); 
     240        $core->auth->user_prefs->interface->put('darkmode', !empty($_POST['user_ui_darkmode']), 'boolean'); 
    239241        $core->auth->user_prefs->interface->put('enhanceduploader', !empty($_POST['user_ui_enhanceduploader']), 'boolean'); 
    240242        $core->auth->user_prefs->interface->put('hidemoreinfo', !empty($_POST['user_ui_hidemoreinfo']), 'boolean'); 
     
    527529'<h4 id="user_options_interface">' . __('Interface') . '</h4>' . 
    528530 
     531'<p><label for="user_ui_darkmode" class="classic">' . 
     532form::checkbox('user_ui_darkmode', 1, $user_ui_darkmode) . ' ' . 
     533__('Activate dark mode') . '</label></p>' . 
     534 
    529535'<p><label for="user_ui_enhanceduploader" class="classic">' . 
    530536form::checkbox('user_ui_enhanceduploader', 1, $user_ui_enhanceduploader) . ' ' . 
  • admin/style/default.css

    r3769 r3770  
    886886  a:visited img { 
    887887    border: none; 
    888     background: inherit; } 
     888    background: initial; } 
    889889 
    890890a:hover, 
     
    10111011  border-style: solid; 
    10121012  border-color: #dbdbdb; } 
     1013 
     1014input[type=file] { 
     1015  color: #323232; 
     1016  background: #fff; } 
    10131017 
    10141018input:invalid:not(:required), textarea:invalid:not(:required), select:invalid:not(:required), input:not([type=file]):invalid:not(:focus):not(:required) { 
     
    20972101    padding-bottom: 6px; 
    20982102    font-size: 1em; } 
     2103  #login-screen input.details-cmd { 
     2104    width: auto; 
     2105    margin: 0 5px 0 0; 
     2106    padding: 0; } 
    20992107  #login-screen #issue { 
    21002108    margin-left: 1.33em; 
     
    21282136    border-radius: 8px; 
    21292137    border: 1px solid #dbdbdb; 
    2130     display: inline-block; } 
     2138    display: inline-block; 
     2139    filter: contrast(100%); } 
    21312140  #icons a:focus { 
    21322141    outline: 0; } 
     
    29292938.ac_loading { 
    29302939  background: transparent url("loader.gif") right center no-repeat; } 
     2940 
     2941.ac_odd { 
     2942  background-color: #fff; } 
    29312943 
    29322944.ac_over { 
  • admin/style/scss/partials/_auth.scss

    r3763 r3770  
    5151          font-size: 1em; 
    5252     } 
     53  input.details-cmd { 
     54    width: auto; 
     55    margin: 0 5px 0 0; 
     56    padding: 0; 
     57  } 
    5358     #issue { 
    5459          margin-left: 1.33em; 
  • admin/style/scss/partials/_classes.scss

    r3763 r3770  
    2929} 
    3030 
     31.ac_odd { 
     32  background-color: $ac-results-background; 
     33} 
     34 
    3135.ac_over { 
    3236  color: $ac-results-over; 
  • admin/style/scss/partials/_forms.scss

    r3767 r3770  
    104104  border-color: $input-border; 
    105105} 
     106input[type=file] { 
     107  color: $input-file-color; 
     108  background: $input-file-background; 
     109} 
    106110// Special for invalid but not required fields 
    107111input:invalid:not(:required), textarea:invalid:not(:required), select:invalid:not(:required), input:not([type=file]):invalid:not(:focus):not(:required) { 
  • admin/style/scss/partials/_index.scss

    r3764 r3770  
    3434               border: 1px solid $index-icon-border; 
    3535               display: inline-block; 
     36      filter: contrast($index-icon-contrast); 
    3637          } 
    3738          &:focus { 
  • admin/style/scss/partials/_markup.scss

    r3767 r3770  
    182182     img { 
    183183          border: none; 
    184           background: inherit; 
     184          background: initial; 
    185185     } 
    186186} 
  • admin/style/scss/themes/_light.scss

    r3768 r3770  
    170170$input-focus:                     $link-outline;                      // #bee74b 
    171171 
     172$input-file-color:                $body-color; 
     173$input-file-background:           $body-background; 
     174 
    172175$form-note-color:                 $gray-dark;                         // #676e78 
    173176 
     
    279282 
    280283// Application pages: 
    281 // - Auth 
     284// - Auth (white background page) 
    282285 
    283286$login-fieldset-background:       $white;                             // #ffffff 
     
    291294$index-icon-border:               shade($gray-very-light, 10%);       // #dbdbdb 
    292295$index-icon-outline:              $link-outline;                      // #bee74b 
     296$index-icon-contrast:             100%; 
    293297 
    294298$quick-background:                $gray-very-light;                   // #f3f3f3 
  • inc/admin/lib.dc.page.php

    r3769 r3770  
    165165        '  <meta name="GOOGLEBOT" content="NOSNIPPET" />' . "\n" . 
    166166        '  <meta name="viewport" content="width=device-width, initial-scale=1.0" />' . "\n" . 
    167         '  <title>' . $title . ' - ' . html::escapeHTML($core->blog->name) . ' - ' . html::escapeHTML(DC_VENDOR_NAME) . ' - ' . DC_VERSION . '</title>' . "\n" . 
    168  
    169         self::cssLoad('style/default.css'); 
     167        '  <title>' . $title . ' - ' . html::escapeHTML($core->blog->name) . ' - ' . html::escapeHTML(DC_VENDOR_NAME) . ' - ' . DC_VERSION . '</title>' . "\n"; 
     168 
     169      if ($core->auth->user_prefs->interface->darkmode) { 
     170            echo self::cssLoad('style/default-dark.css'); 
     171      } else { 
     172            echo self::cssLoad('style/default.css'); 
     173      } 
    170174        if (l10n::getTextDirection($GLOBALS['_lang']) == 'rtl') { 
    171175            echo self::cssLoad('style/default-rtl.css'); 
     
    433437 
    434438        '  <meta name="ROBOTS" content="NOARCHIVE,NOINDEX,NOFOLLOW" />' . "\n" . 
    435         '  <meta name="GOOGLEBOT" content="NOSNIPPET" />' . "\n" . 
    436  
    437         self::cssLoad('style/default.css'); 
     439        '  <meta name="GOOGLEBOT" content="NOSNIPPET" />' . "\n"; 
     440 
     441        if ($core->auth->user_prefs->interface->darkmode) { 
     442            echo self::cssLoad('style/default-dark.css'); 
     443        } else { 
     444            echo self::cssLoad('style/default.css'); 
     445        } 
    438446        if (l10n::getTextDirection($GLOBALS['_lang']) == 'rtl') { 
    439447            echo self::cssLoad('style/default-rtl.css'); 
  • locales/fr/main.po

    r3757 r3770  
    21962196msgstr "Interface" 
    21972197 
     2198msgid "Activate dark mode" 
     2199msgstr "Activer le mode sombre" 
     2200 
    21982201msgid "Activate enhanced uploader in media manager" 
    21992202msgstr "Activer l'interface avancée de la médiathèque" 
  • plugins/tags/style.css

    r3447 r3770  
    22 
    33.tag10 { 
    4      font-size: 140%; 
     4  font-size: 140%; 
    55} 
    66 
    77.tag20 { 
    8      font-size: 150%; 
     8  font-size: 150%; 
    99} 
    1010 
    1111.tag30 { 
    12      font-size: 160%; 
     12  font-size: 160%; 
    1313} 
    1414 
    1515.tag40 { 
    16      font-size: 170%; 
     16  font-size: 170%; 
    1717} 
    1818 
    1919.tag50 { 
    20      font-size: 180%; 
     20  font-size: 180%; 
    2121} 
    2222 
    2323.tag60 { 
    24      font-size: 190%; 
     24  font-size: 190%; 
    2525} 
    2626 
    2727.tag70 { 
    28      font-size: 200%; 
     28  font-size: 200%; 
    2929} 
    3030 
    3131.tag80 { 
    32      font-size: 210%; 
     32  font-size: 210%; 
    3333} 
    3434 
    3535.tag90 { 
    36      font-size: 220%; 
     36  font-size: 220%; 
    3737} 
    3838 
    3939.tag100 { 
    40      font-size: 230%; 
     40  font-size: 230%; 
    4141} 
    4242 
    4343table.tags { 
    44      margin-left: 3em; 
     44  margin-left: 3em; 
    4545} 
    4646 
    4747tr.tagLetter span { 
    48      font-size: 250%; 
    49      border: none; 
    50      display: block; 
    51      width: 1ex; 
    52      position: relative; 
    53      top: 0.80em; 
    54      left: -2ex; 
     48  font-size: 250%; 
     49  border: none; 
     50  display: block; 
     51  width: 1ex; 
     52  position: relative; 
     53  top: 0.80em; 
     54  left: -2ex; 
    5555} 
    5656 
    5757ul.metaList { 
    58      margin: 0 0 1em 0; 
    59      padding: 0; 
     58  margin: 0 0 1em 0; 
     59  padding: 0; 
    6060} 
    6161 
    6262ul.metaList li { 
    63      margin: 0; 
    64      padding: 0; 
    65      list-style: none; 
    66      list-style-position: inside; 
    67 } 
    68  
    69  
    70 /* 
    71 a.metaRemove { 
    72      color : #999 !important; 
    73      border: none; 
    74      } 
    75 a.metaRemove:hover, a.metaRemove:focus { 
    76      color : #2373A8 !important; 
    77      } 
    78 .addMeta a { 
    79      border: none; 
    80      } 
    81 .addMeta a:hover, .addMeta a:focus { 
    82      background: #fc0; 
    83      color: #000; 
    84      } 
    85 .addMeta a.metaGetMore { 
    86      font-weight: bold; 
    87      } 
    88 */ 
    89  
    90  
    91 /* Auto Complete */ 
    92  
    93 .ac_results { 
    94      padding: 0px; 
    95      border: 1px dotted #f90; 
    96      background-color: white; 
    97      overflow: hidden; 
    98      z-index: 99999; 
    99 } 
    100  
    101 .ac_results ul { 
    102      width: 100%; 
    103      list-style-position: outside; 
    104      list-style: none; 
    105      padding: 0; 
    106      margin: 0; 
    107 } 
    108  
    109 .ac_results li { 
    110      margin: 0px; 
    111      padding: 2px 5px; 
    112      cursor: default; 
    113      display: block; 
    114      /* 
    115      if width will be 100% horizontal scrollbar will apear 
    116      when scroll mode will be used 
    117      */ 
    118      /*width: 100%;*/ 
    119      font: menu; 
    120      font-size: 1em; 
    121      /* 
    122      it is very important, if line-height not setted or setted 
    123      in relative units scroll will be broken in firefox 
    124      */ 
    125      line-height: 16px; 
    126      overflow: hidden; 
    127 } 
    128  
    129 .ac_loading { 
    130      background: transparent url('index.php?pf=tags/img/loader.gif') right center no-repeat; 
    131 } 
    132  
    133 .ac_odd { 
    134      background-color: #eee; 
    135 } 
    136  
    137 .ac_over { 
    138      background-color: #2373A8; 
    139      color: white; 
     63  margin: 0; 
     64  padding: 0; 
     65  list-style: none; 
     66  list-style-position: inside; 
    14067} 
    14168 
    14269#post_meta_input:focus { 
    143      -moz-box-sizing: content-box; 
     70  -moz-box-sizing: content-box; 
    14471} 
    14572 
    14673#tags-edit input[type=text] { 
    147      width: 11.5em; 
     74  width: 11.5em; 
    14875} 
    14976 
    15077.tag-actions form { 
    151      display: inline-block; 
    152      margin-right: 1.5em; 
     78  display: inline-block; 
     79  margin-right: 1.5em; 
    15380} 
Note: See TracChangeset for help on using the changeset viewer.

Sites map