_entries.scss 4.9 KB

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