1%entry,
2entry {
3  %entry_basic, & {
4    min-height: 32px;
5    padding-left: 8px;
6    padding-right: 8px;
7    border: 1px solid;
8    border-radius: $button_radius;
9    border-spacing: 6px;
10    background-clip: padding-box;
11    transition: all 200ms $ease-out-quad;
12    caret-color: currentColor;
13
14    @include entry(normal);
15
16    @include focus-ring($focus-state: ':focus-within');
17
18    > text {
19      > placeholder {
20        @extend .dim-label;
21      }
22
23      > block-cursor {
24        @include entry(block_cursor);
25      }
26    }
27
28    &.flat {
29      &:focus-within, &:disabled, & {
30        min-height: 0;
31        padding: 2px;
32        background-color: transparent;
33        border-color: transparent;
34        border-radius: 0;
35      }
36    }
37
38    &:disabled { @include entry(insensitive); }
39
40    // entry error and warning style
41    @each $e_type, $e_color in (error, $error_color),
42                               (warning, $warning_color) {
43      &.#{$e_type} {
44        color: gtkmix($e_color, $text_color, 70%);
45
46        @include focus-ring($focus-state: ':focus-within', $fc: gtkalpha($e_color, 0.5));
47
48        > text {
49          > selection:focus-within { background-color: gtkalpha($e_color, .2); }
50
51          > cursor-handle > contents { background-color: $e_color; }
52        }
53      }
54    }
55
56    > image { // icons inside the entry
57      opacity: 0.6;
58
59      &:hover { opacity: 1; }
60
61      &:active { color: $accent_color; }
62
63      &.left { margin-right: 6px; }
64      &.right { margin-left: 6px; }
65    }
66
67    &.password image.caps-lock-indicator {
68      opacity: 0.3;
69    }
70
71    &:drop(active) {
72      &:focus-within, & {
73        border-color: $drop_target_color;
74        box-shadow: inset 0 0 0 1px $drop_target_color;
75      }
76    }
77
78    .osd & {
79      @include entry(osd);
80
81      &:focus-within { @include entry(osd-focus); }
82    }
83  }
84
85  > progress {
86    margin-bottom: 2px;
87
88    > trough > progress {
89      background-color: transparent;
90      background-image: none;
91      border-radius: 0;
92      border-width: 0 0 2px;
93      border-color: $accent_bg_color;
94      border-style: solid;
95      box-shadow: none;
96    }
97  }
98}
99
100treeview entry {
101  &:focus-within {
102    &:dir(rtl), &:dir(ltr) { // specificity bump hack
103      background-color: $base_color;
104      transition-property: color, background;
105    }
106  }
107
108  &.flat, & {
109    border-radius: 0;
110    background-image: none;
111    background-color: $base_color;
112
113    &:focus-within { border-color: $accent_bg_color; }
114  }
115}
116