dropbutton.css 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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. display: block;
  15. position: relative;
  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: 30px;
  39. }
  40. .js td .dropbutton-multiple {
  41. padding-right: 10em; /* LTR */
  42. margin-right: 2em; /* LTR */
  43. max-width: 100%;
  44. }
  45. [dir="rtl"].js td .dropbutton-multiple {
  46. padding-right: 0;
  47. margin-right: 0;
  48. padding-left: 10em;
  49. margin-left: 2em;
  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. list-style-image: none;
  59. list-style-type: none;
  60. margin: 0;
  61. overflow: hidden;
  62. padding: 0;
  63. }
  64. .js .dropbutton li,
  65. .js .dropbutton a {
  66. display: block;
  67. }
  68. .js .dropbutton li:hover,
  69. .js .dropbutton li:focus,
  70. .js .dropbutton a:hover,
  71. .js .dropbutton a:focus {
  72. outline: initial;
  73. }
  74. /**
  75. * The dropbutton styling.
  76. *
  77. * A dropbutton is a widget that displays a list of action links as a button
  78. * with a primary action. Secondary actions are hidden behind a click on a
  79. * twisty arrow.
  80. *
  81. * The arrow is created using border on a zero-width, zero-height span.
  82. * The arrow inherits the link color, but can be overridden with border colors.
  83. */
  84. .js .dropbutton-multiple .dropbutton-widget {
  85. padding-right: 2em; /* LTR */
  86. }
  87. .js[dir="rtl"] .dropbutton-multiple .dropbutton-widget {
  88. padding-left: 2em;
  89. padding-right: 0;
  90. }
  91. .dropbutton-multiple.open,
  92. .dropbutton-multiple.open .dropbutton-widget {
  93. max-width: none;
  94. }
  95. .dropbutton-multiple.open {
  96. z-index: 100;
  97. }
  98. .dropbutton-multiple .dropbutton .secondary-action {
  99. display: none;
  100. }
  101. .dropbutton-multiple.open .dropbutton .secondary-action {
  102. display: block;
  103. }
  104. .dropbutton-toggle {
  105. bottom: 0;
  106. display: block;
  107. position: absolute;
  108. right: 0; /* LTR */
  109. text-indent: 110%;
  110. top: 0;
  111. white-space: nowrap;
  112. width: 2em;
  113. }
  114. [dir="rtl"] .dropbutton-toggle {
  115. left: 0;
  116. right: auto;
  117. }
  118. .dropbutton-toggle button {
  119. background: none;
  120. border: 0;
  121. cursor: pointer;
  122. display: block;
  123. height: 100%;
  124. margin: 0;
  125. padding: 0;
  126. width: 100%;
  127. }
  128. .dropbutton-toggle button:hover,
  129. .dropbutton-toggle button:focus {
  130. outline: initial;
  131. }
  132. .dropbutton-arrow {
  133. border-bottom-color: transparent;
  134. border-left-color: transparent;
  135. border-right-color: transparent;
  136. border-style: solid;
  137. border-width: 0.3333em 0.3333em 0;
  138. display: block;
  139. height: 0;
  140. line-height: 0;
  141. position: absolute;
  142. right: 40%; /* 0.6667em; */ /* LTR */
  143. top: 50%;
  144. margin-top: -0.1666em;
  145. width: 0;
  146. overflow: hidden;
  147. }
  148. [dir="rtl"] .dropbutton-arrow {
  149. left: 0.6667em;
  150. right: auto;
  151. }
  152. .dropbutton-multiple.open .dropbutton-arrow {
  153. border-bottom: 0.3333em solid;
  154. border-top-color: transparent;
  155. top: 0.6667em;
  156. }