| 1 | /**************** |
| 2 | * Text Entries * |
| 3 | ****************/ |
| 4 | |
| 5 | %entry, |
| 6 | entry { |
| 7 | %entry_basic, & { |
| 8 | min-height: 28px; |
| 9 | padding-left: 8px; |
| 10 | padding-right: 8px; |
| 11 | border: 1px solid; |
| 12 | border-radius: 3px; |
| 13 | transition: all 200ms $ease-out-quad; |
| 14 | |
| 15 | @include entry(normal); |
| 16 | |
| 17 | image { // icons inside the entry |
| 18 | &.left { padding-left: 0; padding-right: 6px; } |
| 19 | &.right { padding-left: 6px; padding-right: 0; } |
| 20 | } |
| 21 | |
| 22 | |
| 23 | &.flat { |
| 24 | &:focus, & { |
| 25 | min-height: 0; |
| 26 | padding: 2px; |
| 27 | background-image: none; |
| 28 | border-color: transparent; |
| 29 | box-shadow: none; |
| 30 | border-radius: 0; |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | &:focus { @include entry(focus); } |
| 35 | |
| 36 | &:disabled { @include entry(insensitive); } |
| 37 | |
| 38 | &:backdrop { |
| 39 | @include entry(backdrop); |
| 40 | |
| 41 | transition: $backdrop_transition; |
| 42 | } |
| 43 | |
| 44 | &:backdrop:disabled { @include entry(backdrop-insensitive); } |
| 45 | |
| 46 | selection { &:focus, & { @extend %selected_items; }} |
| 47 | |
| 48 | // entry error and warning style |
| 49 | @each $e_type, $e_color in (error, $error_color), |
| 50 | (warning, $warning_color) { |
| 51 | &.#{$e_type} { |
| 52 | @include entry(normal); |
| 53 | color: $e_color; |
| 54 | border-color: entry_focus_border($e_color); |
| 55 | |
| 56 | &:focus { @include entry(focus, $e_color); } |
| 57 | |
| 58 | &:selected { &:focus, & { background-color: $e_color; }} |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | & image { // entry icons colors |
| 63 | color: mix($fg_color, $base_color, 80%); |
| 64 | |
| 65 | &:hover { color: $fg_color; } |
| 66 | |
| 67 | &:active { color: $selected_bg_color; } |
| 68 | |
| 69 | &:backdrop { color: mix($backdrop_fg_color, $backdrop_base_color, 80%); } |
| 70 | } |
| 71 | |
| 72 | &:drop(active) { |
| 73 | &:focus, & { |
| 74 | border-color: $drop_target_color; |
| 75 | box-shadow: inset 0 0 0 1px $drop_target_color; |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | .osd & { |
| 80 | @include entry(osd); |
| 81 | |
| 82 | &:focus { @include entry(osd-focus); } |
| 83 | |
| 84 | &:backdrop { @include entry(osd-backdrop); } |
| 85 | |
| 86 | &:disabled { @include entry(osd-insensitive); } |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | progress { |
| 91 | margin: 2px -6px; |
| 92 | background-color: transparent; |
| 93 | background-image: none; |
| 94 | border-radius: 0; |
| 95 | border-width: 0 0 2px; |
| 96 | border-color: $selected_bg_color; |
| 97 | border-style: solid; |
| 98 | box-shadow: none; |
| 99 | |
| 100 | &:backdrop { background-color: transparent; } |
| 101 | } |
| 102 | |
| 103 | // linked entries |
| 104 | .linked:not(.vertical) > & { @extend %linked; } |
| 105 | .linked:not(.vertical) > &:focus + &, |
| 106 | .linked:not(.vertical) > &:focus + button, |
| 107 | .linked:not(.vertical) > &:focus + combobox > box > button.combo { border-left-color: entry_focus_border(); } |
| 108 | |
| 109 | .linked:not(.vertical) > &:focus { border-color: entry_focus_border(); } |
| 110 | |
| 111 | .linked:not(.vertical) > &:drop(active) + &, |
| 112 | .linked:not(.vertical) > &:drop(active) + button, |
| 113 | .linked:not(.vertical) > &:drop(active) + combobox > box > button.combo { border-left-color: $drop_target_color; } |
| 114 | |
| 115 | // Vertically linked entries |
| 116 | // FIXME: take care of "colored" entries |
| 117 | .linked.vertical > & { |
| 118 | @extend %linked_vertical; |
| 119 | |
| 120 | // brighter border between linked entries |
| 121 | &:not(:disabled) + entry:not(:disabled), |
| 122 | &:not(:disabled) + %entry:not(:disabled) { |
| 123 | border-top-color: mix($borders_color, $base_color, 30%); |
| 124 | background-image: linear-gradient(to bottom, $base_color, $base_color); |
| 125 | |
| 126 | &:backdrop { |
| 127 | border-top-color: mix($backdrop_borders_color, $backdrop_base_color, 30%); |
| 128 | background-image: linear-gradient(to bottom, $backdrop_base_color, $backdrop_base_color); |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | // brighter border between linked insensitive entries |
| 133 | &:disabled + %entry:disabled, |
| 134 | &:disabled + entry:disabled { border-top-color: mix($borders_color, $base_color, 30%); } |
| 135 | |
| 136 | // color back the top border of a linked focused entry following another entry and add back the focus shadow. |
| 137 | // :not(:only-child) is a specificity bump hack. |
| 138 | + %entry:focus:not(:only-child), |
| 139 | + entry:focus:not(:only-child) { border-top-color: entry_focus_border(); } |
| 140 | |
| 141 | + %entry:drop(active):not(:only-child), |
| 142 | + entry:drop(active):not(:only-child) { border-top-color: $drop_target_color; } |
| 143 | |
| 144 | // this takes care of coloring the top border of the focused entry subsequent widget. |
| 145 | // :not(:only-child) is a specificity bump hack. |
| 146 | &:focus:not(:only-child) { |
| 147 | + %entry, |
| 148 | + entry, |
| 149 | + button, |
| 150 | + combobox > box > button.combo { border-top-color: entry_focus_border(); } |
| 151 | } |
| 152 | |
| 153 | &:drop(active):not(:only-child) { |
| 154 | + %entry, |
| 155 | + entry, |
| 156 | + button, |
| 157 | + combobox > box > button.combo { border-top-color: $drop_target_color; } |
| 158 | } |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | treeview entry { |
| 163 | &:focus { |
| 164 | &:dir(rtl), &:dir(ltr) { // specificity bump hack |
| 165 | background-color: $base_color; |
| 166 | transition-property: color, background; |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | &.flat, & { |
| 171 | border-radius: 0; |
| 172 | background-image: none; |
| 173 | background-color: $base_color; |
| 174 | |
| 175 | &:focus { border-color: $selected_bg_color; } |
| 176 | } |
| 177 | } |