dropbutton.css 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. /**
  2. * @file
  3. * Base styles for dropbuttons.
  4. */
  5. /**
  6. * When a dropbutton has only one option, it is simply a button.
  7. */
  8. .dropbutton-wrapper,
  9. .dropbutton-wrapper div {
  10. box-sizing: border-box;
  11. }
  12. .js .dropbutton-wrapper,
  13. .js .dropbutton-widget {
  14. position: relative;
  15. display: block;
  16. }
  17. @media screen and (max-width: 600px) {
  18. .js .dropbutton-wrapper {
  19. width: 100%;
  20. }
  21. }
  22. /* Splitbuttons */
  23. @media screen and (min-width: 600px) {
  24. .form-actions .dropbutton-wrapper {
  25. float: left; /* LTR */
  26. }
  27. [dir="rtl"] .form-actions .dropbutton-wrapper {
  28. float: right;
  29. }
  30. }
  31. .js .form-actions .dropbutton-widget {
  32. position: static;
  33. }
  34. .js td .dropbutton-widget {
  35. position: absolute;
  36. }
  37. .js td .dropbutton-wrapper {
  38. min-height: 2em;
  39. }
  40. .js td .dropbutton-multiple {
  41. max-width: 100%;
  42. margin-right: 2em; /* LTR */
  43. padding-right: 10em; /* LTR */
  44. }
  45. [dir="rtl"].js td .dropbutton-multiple {
  46. margin-right: 0;
  47. margin-left: 2em;
  48. padding-right: 0;
  49. padding-left: 10em;
  50. }
  51. .js td .dropbutton-multiple .dropbutton-action a,
  52. .js td .dropbutton-multiple .dropbutton-action input,
  53. .js td .dropbutton-multiple .dropbutton-action button {
  54. width: auto;
  55. }
  56. /* UL styles are over-scoped in core, so this selector needs weight parity. */
  57. .js .dropbutton-widget .dropbutton {
  58. overflow: hidden;
  59. margin: 0;
  60. padding: 0;
  61. list-style-type: none;
  62. list-style-image: none;
  63. }
  64. .js .dropbutton li,
  65. .js .dropbutton a {
  66. display: block;
  67. outline: none;
  68. }
  69. .js .dropbutton li:hover,
  70. .js .dropbutton li:focus,
  71. .js .dropbutton a:hover,
  72. .js .dropbutton a:focus {
  73. outline: initial;
  74. }
  75. /**
  76. * The dropbutton styling.
  77. *
  78. * A dropbutton is a widget that displays a list of action links as a button
  79. * with a primary action. Secondary actions are hidden behind a click on a
  80. * twisty arrow.
  81. *
  82. * The arrow is created using border on a zero-width, zero-height span.
  83. * The arrow inherits the link color, but can be overridden with border colors.
  84. */
  85. .js .dropbutton-multiple .dropbutton-widget {
  86. padding-right: 2em; /* LTR */
  87. }
  88. .js[dir="rtl"] .dropbutton-multiple .dropbutton-widget {
  89. padding-right: 0;
  90. padding-left: 2em;
  91. }
  92. .dropbutton-multiple.open,
  93. .dropbutton-multiple.open .dropbutton-widget {
  94. max-width: none;
  95. }
  96. .dropbutton-multiple.open {
  97. z-index: 100;
  98. }
  99. .dropbutton-multiple .dropbutton .secondary-action {
  100. display: none;
  101. }
  102. .dropbutton-multiple.open .dropbutton .secondary-action {
  103. display: block;
  104. }
  105. .dropbutton-toggle {
  106. position: absolute;
  107. top: 0;
  108. right: 0; /* LTR */
  109. bottom: 0;
  110. display: block;
  111. width: 2em;
  112. white-space: nowrap;
  113. text-indent: 110%;
  114. }
  115. [dir="rtl"] .dropbutton-toggle {
  116. right: auto;
  117. left: 0;
  118. }
  119. .dropbutton-toggle button {
  120. display: block;
  121. width: 100%;
  122. height: 100%;
  123. margin: 0;
  124. padding: 0;
  125. cursor: pointer;
  126. border: 0;
  127. background: none;
  128. }
  129. .dropbutton-toggle button:hover,
  130. .dropbutton-toggle button:focus {
  131. outline: initial;
  132. }
  133. .dropbutton-arrow {
  134. position: absolute;
  135. top: 50%;
  136. right: 40%; /* 0.6667em; */ /* LTR */
  137. display: block;
  138. overflow: hidden;
  139. width: 0;
  140. height: 0;
  141. margin-top: -0.1666em;
  142. border-width: 0.3333em 0.3333em 0;
  143. border-style: solid;
  144. border-right-color: transparent;
  145. border-bottom-color: transparent;
  146. border-left-color: transparent;
  147. line-height: 0;
  148. }
  149. [dir="rtl"] .dropbutton-arrow {
  150. right: auto;
  151. left: 0.6667em;
  152. }
  153. .dropbutton-multiple.open .dropbutton-arrow {
  154. top: 0.6667em;
  155. border-top-color: transparent;
  156. border-bottom: 0.3333em solid;
  157. }