tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

filter-widget.css (4949B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 /* Main container: Displays the filters and presets in 2 columns */
      6 
      7 #filter-container {
      8  width: 510px;
      9  height: 200px;
     10  display: flex;
     11  position: relative;
     12  padding: 5px;
     13  box-sizing: border-box;
     14  /* when opened in a xul:panel, a gray color is applied to text */
     15  color: var(--theme-body-color);
     16 }
     17 
     18 #filter-container.dragging {
     19  user-select: none;
     20 }
     21 
     22 #filter-container .filters-list,
     23 #filter-container .presets-list {
     24  display: flex;
     25  flex-direction: column;
     26  box-sizing: border-box;
     27 }
     28 
     29 #filter-container .filters-list {
     30  /* Allow the filters list to take the full width when the presets list is
     31     hidden */
     32  flex-grow: 1;
     33  padding: 0 6px;
     34 }
     35 
     36 #filter-container .presets-list {
     37  /* Make sure that when the presets list is shown, it has a fixed width */
     38  width: 200px;
     39  padding-left: 6px;
     40  transition: width 0.1s;
     41  flex-shrink: 0;
     42  border-left: 1px solid var(--theme-splitter-color);
     43 }
     44 
     45 #filter-container:not(.show-presets) .presets-list {
     46  width: 0;
     47  border-left: none;
     48  padding-left: 0;
     49  /* To hide also element's children, not on only the element */
     50  overflow: hidden;
     51 }
     52 
     53 #filter-container.show-presets .filters-list {
     54  width: 300px;
     55 }
     56 
     57 /* The list of filters and list of presets should push their footers to the
     58   bottom, so they can take as much space as there is */
     59 
     60 #filter-container #filters,
     61 #filter-container #presets {
     62  flex-grow: 1;
     63  /* Avoid pushing below the tooltip's area */
     64  overflow-y: auto;
     65 }
     66 
     67 /* The filters and presets list both have footers displayed at the bottom.
     68   These footers have some input (taking up as much space as possible) and an
     69   add button next */
     70 
     71 #filter-container .footer {
     72  display: flex;
     73  margin: 10px 3px;
     74  align-items: center;
     75 }
     76 
     77 #filter-container .footer :not(button) {
     78  flex-grow: 1;
     79  margin-right: 3px;
     80 }
     81 
     82 /* Styles for 1 filter function item */
     83 
     84 #filter-container .filter,
     85 #filter-container .filter-name,
     86 #filter-container .filter-value {
     87  display: flex;
     88  align-items: center;
     89 }
     90 
     91 #filter-container .filter {
     92  margin: 5px 0;
     93 }
     94 
     95 #filter-container .filter-name {
     96  width: 120px;
     97  margin-right: 10px;
     98 }
     99 
    100 #filter-container .filter-name label {
    101  user-select: none;
    102  flex-grow: 1;
    103 }
    104 
    105 #filter-container .filter-name label.devtools-draglabel {
    106  cursor: ew-resize;
    107 }
    108 
    109 /* drag/drop handle */
    110 
    111 #filter-container .filter-name i {
    112  width: 10px;
    113  height: 10px;
    114  margin-right: 10px;
    115  cursor: grab;
    116  background: linear-gradient(to bottom, currentColor 0, currentcolor 1px, transparent 1px, transparent 2px);
    117  background-repeat: repeat-y;
    118  background-size: auto 4px;
    119  background-position: 0 1px;
    120 }
    121 
    122 #filter-container .filter-value {
    123  min-width: 150px;
    124  margin-right: 10px;
    125  flex: 1;
    126 }
    127 
    128 #filter-container .filter-value input {
    129  flex-grow: 1;
    130 }
    131 
    132 /* Fix the size of inputs */
    133 /* Especially needed on Linux where input are bigger */
    134 #filter-container input {
    135  width: 8em;
    136 }
    137 
    138 #filter-container .preset {
    139  display: flex;
    140  margin-bottom: 10px;
    141  cursor: pointer;
    142  padding: 3px 5px;
    143 
    144  flex-direction: row;
    145  flex-wrap: wrap;
    146 }
    147 
    148 #filter-container .preset label,
    149 #filter-container .preset span {
    150  display: flex;
    151  align-items: center;
    152 }
    153 
    154 #filter-container .preset label {
    155  flex: 1 0;
    156  cursor: pointer;
    157  color: var(--theme-body-color);
    158 }
    159 
    160 #filter-container .preset:hover {
    161  background: var(--theme-selection-background);
    162 }
    163 
    164 #filter-container .preset:hover label,
    165 #filter-container .preset:hover span {
    166  color: var(--theme-selection-color);
    167 }
    168 
    169 #filter-container .preset .remove-button {
    170  order: 2;
    171 }
    172 
    173 #filter-container .preset span {
    174  flex: 2 100%;
    175  white-space: nowrap;
    176  overflow: hidden;
    177  text-overflow: ellipsis;
    178  display: block;
    179  order: 3;
    180  color: var(--theme-text-color-alt);
    181 }
    182 
    183 #filter-container .remove-button {
    184  width: 16px;
    185  height: 16px;
    186  background: url(chrome://devtools/skin/images/close.svg);
    187  background-size: cover;
    188  font-size: 0;
    189  border: none;
    190  cursor: pointer;
    191 }
    192 
    193 #filter-container .hidden {
    194  display: none !important;
    195 }
    196 
    197 #filter-container .dragging {
    198  position: relative;
    199  z-index: 10;
    200  cursor: grab;
    201 }
    202 
    203 /* message shown when there's no filter specified */
    204 #filter-container p {
    205  text-align: center;
    206  line-height: 20px;
    207 }
    208 
    209 #filter-container .add,
    210 #toggle-presets {
    211  background-size: cover;
    212  border: none;
    213  width: 16px;
    214  height: 16px;
    215  font-size: 0;
    216  vertical-align: middle;
    217  cursor: pointer;
    218  margin: 0 5px;
    219 }
    220 
    221 #filter-container .add {
    222  background: url(chrome://devtools/skin/images/add.svg);
    223 }
    224 
    225 #toggle-presets {
    226  background: url(chrome://devtools/skin/images/pseudo-class.svg);
    227 }
    228 
    229 #filter-container .add,
    230 #filter-container .remove-button,
    231 #toggle-presets {
    232  -moz-context-properties: fill;
    233  fill: var(--theme-icon-color);
    234 }
    235 
    236 .show-presets #toggle-presets {
    237  fill: var(--theme-icon-checked-color);
    238 }