dropbutton.component.css

Same filename in this branch
  1. 8.9.x core/themes/bartik/css/components/dropbutton.component.css
Same filename in other branches
  1. 9 core/themes/seven/css/components/dropbutton.component.css
  2. 9 core/themes/bartik/css/components/dropbutton.component.css

Styling dropbuttons.

File

core/themes/seven/css/components/dropbutton.component.css

View source
  1. /**
  2. * @file
  3. * Styling dropbuttons.
  4. */
  5. /**
  6. * Reset styling for all elements.
  7. */
  8. .js .dropbutton .dropbutton-action > input,
  9. .js .dropbutton .dropbutton-action > a,
  10. .js .dropbutton .dropbutton-action > button {
  11. margin: 0;
  12. padding: 0;
  13. text-align: left; /* LTR */
  14. text-decoration: none;
  15. color: #333;
  16. font-weight: 600;
  17. line-height: normal;
  18. -webkit-font-smoothing: antialiased;
  19. }
  20. [dir="rtl"].js .dropbutton .dropbutton-action > input,
  21. [dir="rtl"].js .dropbutton .dropbutton-action > a,
  22. [dir="rtl"].js .dropbutton .dropbutton-action > button {
  23. margin-left: 0; /* This is required to win over specificity of [dir="rtl"] .dropbutton-multiple .dropbutton .dropbutton-action > * */
  24. text-align: right;
  25. }
  26. .js .dropbutton-action.last {
  27. border-radius: 0 0 0 1em; /* LTR */
  28. }
  29. [dir="rtl"] .js .dropbutton-action.last {
  30. border-radius: 0 0 1em 0;
  31. }
  32. /**
  33. * Overwrite Sevens button styling.
  34. */
  35. .js .dropbutton-widget .button {
  36. border: 0;
  37. border-radius: 0;
  38. background: transparent;
  39. box-shadow: none;
  40. }
  41. .js .dropbutton-multiple .dropbutton {
  42. border-right: 0; /* LTR */
  43. }
  44. [dir="rtl"].js .dropbutton-multiple .dropbutton {
  45. border-left: 0;
  46. }
  47. /**
  48. * Show dropbutton elements as buttons when javascript is disabled
  49. */
  50. .dropbutton {
  51. margin: 0;
  52. padding: 0;
  53. list-style-type: none;
  54. }
  55. .dropbutton li + li {
  56. margin-top: 10px;
  57. }
  58. .js .dropbutton li {
  59. margin-right: 0;
  60. margin-bottom: 0;
  61. }
  62. .js .dropbutton li + li {
  63. margin-top: 0;
  64. }
  65. @media screen and (min-width: 37.5625em) { /* 601px */
  66. .dropbutton li {
  67. display: inline-block;
  68. }
  69. .dropbutton li + li {
  70. margin-top: 0;
  71. margin-left: 1em;
  72. }
  73. .js .dropbutton li + li {
  74. margin-left: 0;
  75. }
  76. }
  77. /**
  78. * Copied styling for .button.
  79. */
  80. .js .dropbutton-multiple .dropbutton-widget {
  81. border: 1px solid #a6a6a6;
  82. border-radius: 20em;
  83. background-color: #f2f1eb;
  84. background-image: -webkit-linear-gradient(top, #f6f6f3, #e7e7df);
  85. background-image: linear-gradient(to bottom, #f6f6f3, #e7e7df);
  86. text-shadow: 0 1px hsla(0, 0%, 100%, 0.6);
  87. }
  88. .dropbutton-multiple.open .dropbutton-widget {
  89. border-radius: 1em;
  90. }
  91. .js .dropbutton-widget .dropbutton-action a,
  92. .js .dropbutton-widget .dropbutton-action input,
  93. .js .dropbutton-widget .dropbutton-action button {
  94. display: block;
  95. width: 100%;
  96. padding: 4px 1.5em;
  97. border-radius: 20em 0 0 20em; /* LTR */
  98. }
  99. [dir="rtl"].js .dropbutton-widget .dropbutton-action a,
  100. [dir="rtl"].js .dropbutton-widget .dropbutton-action input,
  101. [dir="rtl"].js .dropbutton-widget .dropbutton-action button {
  102. border-radius: 0 20em 20em 0;
  103. }
  104. .js .dropbutton-widget .dropbutton-action a:focus,
  105. .js .dropbutton-widget .dropbutton-action input:focus,
  106. .js .dropbutton-widget .dropbutton-action button:focus {
  107. text-decoration: underline;
  108. }
  109. .js .dropbutton-multiple.open .dropbutton-action a,
  110. .js .dropbutton-multiple.open .dropbutton-action .button {
  111. border-radius: 0;
  112. }
  113. .js .dropbutton-multiple.open .dropbutton-action:first-child a,
  114. .js .dropbutton-multiple.open .dropbutton-action:first-child .button {
  115. border-radius: 0.9em 0 0 0; /* LTR */
  116. }
  117. [dir="rtl"].js .dropbutton-multiple.open .dropbutton-action:first-child a,
  118. [dir="rtl"].js .dropbutton-multiple.open .dropbutton-action:first-child .button {
  119. border-radius: 0 0.9em 0 0;
  120. }
  121. .js .dropbutton-multiple.open .dropbutton-action:last-child a,
  122. .js .dropbutton-multiple.open .dropbutton-action:last-child .button {
  123. border-radius: 0 0 0 0.9em; /* LTR */
  124. }
  125. [dir="rtl"].js .dropbutton-multiple.open .dropbutton-action:last-child a,
  126. [dir="rtl"].js .dropbutton-multiple.open .dropbutton-action:last-child .button {
  127. border-radius: 0 0 0.9em 0;
  128. }
  129. .js .dropbutton-wrapper .dropbutton-widget .dropbutton-action a:hover,
  130. .js .dropbutton-wrapper .dropbutton-widget .dropbutton-action button:hover,
  131. .js .dropbutton-wrapper .dropbutton-widget .dropbutton-action input:hover,
  132. .js .dropbutton-wrapper .dropbutton-widget .dropbutton-action a:focus,
  133. .js .dropbutton-wrapper .dropbutton-widget .dropbutton-action button:focus,
  134. .js .dropbutton-wrapper .dropbutton-widget .dropbutton-action input:focus {
  135. z-index: 3;
  136. color: #1a1a1a;
  137. background-color: #f9f8f6;
  138. background-image: -webkit-linear-gradient(top, #fcfcfa, #e9e9dd);
  139. background-image: linear-gradient(to bottom, #fcfcfa, #e9e9dd);
  140. box-shadow: 0 1px 2px hsla(0, 0%, 0%, 0.125);
  141. }
  142. .js .dropbutton-wrapper .dropbutton-widget .dropbutton-action a:active,
  143. .js .dropbutton-wrapper .dropbutton-widget .dropbutton-action input:active,
  144. .js .dropbutton-wrapper .dropbutton-widget .dropbutton-action button:active {
  145. text-decoration: none;
  146. background-color: #dfdfd9;
  147. background-image: -webkit-linear-gradient(top, #f6f6f3, #e7e7df);
  148. background-image: linear-gradient(to bottom, #f6f6f3, #e7e7df);
  149. box-shadow: inset 0 1px 3px hsla(0, 0%, 0%, 0.2);
  150. }
  151. .dropbutton .secondary-action {
  152. border-top: 1px solid #bfbfba;
  153. }
  154. /**
  155. * Rare instances when a dropbutton is actually just a button.
  156. * Copied from Seven's buttons.css.
  157. */
  158. .dropbutton-single .dropbutton-widget {
  159. position: static;
  160. display: inline-block;
  161. border: 0;
  162. }
  163. .dropbutton-single .dropbutton-action a {
  164. width: auto !important;
  165. padding: 4px 1.5em;
  166. -webkit-transition: all 0.1s;
  167. transition: all 0.1s;
  168. text-decoration: none;
  169. color: #333;
  170. border: 1px solid #a6a6a6;
  171. border-radius: 20em !important;
  172. background-color: #f2f1eb;
  173. background-image: -webkit-linear-gradient(top, #f6f6f3, #e7e7df);
  174. background-image: linear-gradient(to bottom, #f6f6f3, #e7e7df);
  175. text-shadow: 0 1px hsla(0, 0%, 100%, 0.6);
  176. font-weight: 600;
  177. -webkit-font-smoothing: antialiased;
  178. }
  179. .dropbutton-single .dropbutton-action a:hover,
  180. .dropbutton-single .dropbutton-action a:focus {
  181. text-decoration: none;
  182. color: #1a1a1a;
  183. outline: none;
  184. background-color: #f9f8f6;
  185. background-image: -webkit-linear-gradient(top, #fcfcfa, #e9e9dd);
  186. background-image: linear-gradient(to bottom, #fcfcfa, #e9e9dd);
  187. }
  188. .dropbutton-single .dropbutton-action a:hover,
  189. .dropbutton-single .dropbutton-action a:focus {
  190. box-shadow: 0 1px 2px hsla(0, 0%, 0%, 0.125);
  191. }
  192. .dropbutton-single .dropbutton-action a:active {
  193. -webkit-transition: none;
  194. transition: none;
  195. background-color: #dfdfd9;
  196. background-image: -webkit-linear-gradient(top, #f6f6f3, #e7e7df);
  197. background-image: linear-gradient(to bottom, #f6f6f3, #e7e7df);
  198. box-shadow: inset 0 1px 3px hsla(0, 0%, 0%, 0.2);
  199. }
  200. .dropbutton .dropbutton-action .ajax-progress {
  201. position: absolute;
  202. z-index: 2;
  203. top: 0.2em;
  204. right: 0.2em;
  205. padding: 0 0 0 0.1em;
  206. }
  207. .dropbutton-multiple .dropbutton-action .ajax-progress {
  208. top: 0.15em;
  209. right: 2.2em;
  210. margin-right: 0;
  211. }
  212. .dropbutton-multiple .secondary-action .ajax-progress {
  213. top: auto;
  214. bottom: 0.3em;
  215. }
  216. /**
  217. * The dropdown trigger.
  218. */
  219. .js .dropbutton-wrapper .dropbutton-widget .dropbutton-toggle button {
  220. border-left: 1px solid #a6a6a6; /* LTR */
  221. outline: none;
  222. }
  223. [dir="rtl"].js .dropbutton-wrapper .dropbutton-widget .dropbutton-toggle button {
  224. border-right: 1px solid #a6a6a6;
  225. border-left: 0;
  226. }
  227. .js .dropbutton-wrapper .dropbutton-widget .dropbutton-toggle button {
  228. border-radius: 0 20em 20em 0; /* LTR */
  229. }
  230. [dir="rtl"].js .dropbutton-wrapper .dropbutton-widget .dropbutton-toggle button {
  231. border-radius: 20em 0 0 20em;
  232. }
  233. .dropbutton-multiple.open .dropbutton-widget .dropbutton-toggle button {
  234. border-radius: 0 1em 1em 0; /* LTR */
  235. }
  236. [dir="rtl"] .dropbutton-multiple.open .dropbutton-widget .dropbutton-toggle button {
  237. border-radius: 1em 0 0 1em;
  238. }
  239. .js .dropbutton-wrapper .dropbutton-widget .dropbutton-toggle button:hover,
  240. .js .dropbutton-wrapper .dropbutton-widget .dropbutton-toggle button:focus {
  241. z-index: 3;
  242. text-decoration: none;
  243. color: #1a1a1a;
  244. background-color: #f9f8f6;
  245. background-image: -webkit-linear-gradient(top, #fcfcfa, #e9e9dd);
  246. background-image: linear-gradient(to bottom, #fcfcfa, #e9e9dd);
  247. box-shadow: 0 1px 2px hsla(0, 0%, 0%, 0.125);
  248. }
  249. .js .dropbutton-wrapper .dropbutton-widget .dropbutton-toggle button:active {
  250. background-color: #dfdfd9;
  251. background-image: -webkit-linear-gradient(top, #f6f6f3, #e7e7df);
  252. background-image: linear-gradient(to bottom, #f6f6f3, #e7e7df);
  253. box-shadow: inset 0 1px 3px hsla(0, 0%, 0%, 0.2);
  254. }
  255. .dropbutton-arrow {
  256. top: 54%;
  257. right: 35%; /* LTR */
  258. border-top-color: #333;
  259. }
  260. [dir="rtl"] .dropbutton-arrow {
  261. right: auto;
  262. left: 35%;
  263. }
  264. .dropbutton-multiple.open .dropbutton-arrow {
  265. top: 0.6667em;
  266. border-top-color: transparent;
  267. border-bottom: 0.3333em solid #333;
  268. }
  269. /**
  270. * Form edit action theming.
  271. * Copied styling from .button--primary.
  272. */
  273. .js .form-actions .dropbutton .dropbutton-action > * {
  274. color: #fff;
  275. text-shadow: 0 1px hsla(0, 0%, 0%, 0.5);
  276. font-weight: 700;
  277. }
  278. .js .form-actions .dropbutton-widget {
  279. position: relative;
  280. border-color: #1e5c90;
  281. background-color: #0071b8;
  282. background-image: -webkit-linear-gradient(top, #007bc6, #0071b8);
  283. background-image: linear-gradient(to bottom, #007bc6, #0071b8);
  284. text-shadow: 0 1px hsla(0, 0%, 0%, 0.5);
  285. }
  286. .form-actions .dropbutton-multiple.open .dropbutton-widget {
  287. background-image: -webkit-linear-gradient(top, #007bc6, #0071b8);
  288. background-image: linear-gradient(to bottom, #007bc6, #0071b8);
  289. }
  290. .js .form-actions .dropbutton-wrapper .dropbutton-widget .dropbutton-action .button:hover,
  291. .js .form-actions .dropbutton-wrapper .dropbutton-widget .dropbutton-action .button:focus {
  292. color: #fff;
  293. background-color: #2369a6;
  294. background-image: -webkit-linear-gradient(top, #0c97ed, #1f86c7);
  295. background-image: linear-gradient(to bottom, #0c97ed, #1f86c7);
  296. box-shadow: 0 1px 2px hsla(203, 10%, 10%, 0.25);
  297. }
  298. .js .form-actions .dropbutton-wrapper .dropbutton-widget .dropbutton-action .button:active {
  299. border-color: #144b78;
  300. background-image: -webkit-linear-gradient(top, #08639b, #0071b8);
  301. background-image: linear-gradient(to bottom, #08639b, #0071b8);
  302. box-shadow: inset 0 1px 3px hsla(0, 0%, 0%, 0.2);
  303. }
  304. .js .form-actions .dropbutton-wrapper .dropbutton-widget .dropbutton-toggle button,
  305. .form-actions .dropbutton .secondary-action {
  306. border-color: #1e5c90;
  307. }
  308. .js .form-actions .dropbutton-wrapper .dropbutton-widget .dropbutton-toggle button {
  309. background-image: -webkit-linear-gradient(top, #007bc6, #0071b8);
  310. background-image: linear-gradient(to bottom, #007bc6, #0071b8);
  311. }
  312. .js .form-actions .dropbutton-wrapper .dropbutton-widget .dropbutton-toggle button:hover,
  313. .js .form-actions .dropbutton-wrapper .dropbutton-widget .dropbutton-toggle button:focus {
  314. background-color: #2369a6;
  315. background-image: -webkit-linear-gradient(top, #0c97ed, #1f86c7);
  316. background-image: linear-gradient(to bottom, #0c97ed, #1f86c7);
  317. }
  318. .js .form-actions .dropbutton-wrapper .dropbutton-widget .dropbutton-toggle button:active {
  319. border-color: #144b78;
  320. background-image: -webkit-linear-gradient(top, #08639b, #0071b8);
  321. background-image: linear-gradient(to bottom, #08639b, #0071b8);
  322. box-shadow: inset 0 1px 3px hsla(0, 0%, 0%, 0.2);
  323. }
  324. .form-actions .dropbutton-arrow {
  325. border-top-color: #fff;
  326. }
  327. .form-actions .dropbutton-multiple.open .dropbutton-arrow {
  328. border-bottom: 0.3333em solid white;
  329. }

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.