dropbutton.component.css

Same filename in this branch
  1. 9 core/themes/bartik/css/components/dropbutton.component.css
Same filename in other branches
  1. 8.9.x core/themes/seven/css/components/dropbutton.component.css
  2. 8.9.x 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. background: transparent;
  163. }
  164. .dropbutton-single .dropbutton-action a {
  165. width: auto !important;
  166. padding: 4px 1.5em;
  167. -webkit-transition: all 0.1s;
  168. transition: all 0.1s;
  169. text-decoration: none;
  170. color: #333;
  171. border: 1px solid #a6a6a6;
  172. border-radius: 20em !important;
  173. background-color: #f2f1eb;
  174. background-image: -webkit-linear-gradient(top, #f6f6f3, #e7e7df);
  175. background-image: linear-gradient(to bottom, #f6f6f3, #e7e7df);
  176. text-shadow: 0 1px hsla(0, 0%, 100%, 0.6);
  177. font-weight: 600;
  178. -webkit-font-smoothing: antialiased;
  179. }
  180. .dropbutton-single .dropbutton-action a:hover,
  181. .dropbutton-single .dropbutton-action a:focus {
  182. text-decoration: none;
  183. color: #1a1a1a;
  184. outline: none;
  185. background-color: #f9f8f6;
  186. background-image: -webkit-linear-gradient(top, #fcfcfa, #e9e9dd);
  187. background-image: linear-gradient(to bottom, #fcfcfa, #e9e9dd);
  188. }
  189. .dropbutton-single .dropbutton-action a:hover,
  190. .dropbutton-single .dropbutton-action a:focus {
  191. box-shadow: 0 1px 2px hsla(0, 0%, 0%, 0.125);
  192. }
  193. .dropbutton-single .dropbutton-action a:active {
  194. -webkit-transition: none;
  195. transition: none;
  196. background-color: #dfdfd9;
  197. background-image: -webkit-linear-gradient(top, #f6f6f3, #e7e7df);
  198. background-image: linear-gradient(to bottom, #f6f6f3, #e7e7df);
  199. box-shadow: inset 0 1px 3px hsla(0, 0%, 0%, 0.2);
  200. }
  201. .dropbutton .dropbutton-action .ajax-progress {
  202. position: absolute;
  203. z-index: 2;
  204. top: 0.2em;
  205. right: 0.2em;
  206. padding: 0 0 0 0.1em;
  207. }
  208. .dropbutton-multiple .dropbutton-action .ajax-progress {
  209. top: 0.15em;
  210. right: 2.2em;
  211. margin-right: 0;
  212. }
  213. .dropbutton-multiple .secondary-action .ajax-progress {
  214. top: auto;
  215. bottom: 0.3em;
  216. }
  217. /**
  218. * The dropdown trigger.
  219. */
  220. .js .dropbutton-wrapper .dropbutton-widget .dropbutton-toggle button {
  221. border-left: 1px solid #a6a6a6; /* LTR */
  222. outline: none;
  223. }
  224. [dir="rtl"].js .dropbutton-wrapper .dropbutton-widget .dropbutton-toggle button {
  225. border-right: 1px solid #a6a6a6;
  226. border-left: 0;
  227. }
  228. .js .dropbutton-wrapper .dropbutton-widget .dropbutton-toggle button {
  229. border-radius: 0 20em 20em 0; /* LTR */
  230. }
  231. [dir="rtl"].js .dropbutton-wrapper .dropbutton-widget .dropbutton-toggle button {
  232. border-radius: 20em 0 0 20em;
  233. }
  234. .dropbutton-multiple.open .dropbutton-widget .dropbutton-toggle button {
  235. border-radius: 0 1em 1em 0; /* LTR */
  236. }
  237. [dir="rtl"] .dropbutton-multiple.open .dropbutton-widget .dropbutton-toggle button {
  238. border-radius: 1em 0 0 1em;
  239. }
  240. .js .dropbutton-wrapper .dropbutton-widget .dropbutton-toggle button:hover,
  241. .js .dropbutton-wrapper .dropbutton-widget .dropbutton-toggle button:focus {
  242. z-index: 3;
  243. text-decoration: none;
  244. color: #1a1a1a;
  245. background-color: #f9f8f6;
  246. background-image: -webkit-linear-gradient(top, #fcfcfa, #e9e9dd);
  247. background-image: linear-gradient(to bottom, #fcfcfa, #e9e9dd);
  248. box-shadow: 0 1px 2px hsla(0, 0%, 0%, 0.125);
  249. }
  250. .js .dropbutton-wrapper .dropbutton-widget .dropbutton-toggle button:active {
  251. background-color: #dfdfd9;
  252. background-image: -webkit-linear-gradient(top, #f6f6f3, #e7e7df);
  253. background-image: linear-gradient(to bottom, #f6f6f3, #e7e7df);
  254. box-shadow: inset 0 1px 3px hsla(0, 0%, 0%, 0.2);
  255. }
  256. .dropbutton-arrow {
  257. top: 54%;
  258. right: 35%; /* LTR */
  259. border-top-color: #333;
  260. }
  261. [dir="rtl"] .dropbutton-arrow {
  262. right: auto;
  263. left: 35%;
  264. }
  265. .dropbutton-multiple.open .dropbutton-arrow {
  266. top: 0.6667em;
  267. border-top-color: transparent;
  268. border-bottom: 0.3333em solid #333;
  269. }
  270. /**
  271. * Form edit action theming.
  272. * Copied styling from .button--primary.
  273. */
  274. .js .form-actions .dropbutton .dropbutton-action > * {
  275. color: #fff;
  276. text-shadow: 0 1px hsla(0, 0%, 0%, 0.5);
  277. font-weight: 700;
  278. }
  279. .js .form-actions .dropbutton-widget {
  280. position: relative;
  281. border-color: #1e5c90;
  282. background-color: #0071b8;
  283. background-image: -webkit-linear-gradient(top, #007bc6, #0071b8);
  284. background-image: linear-gradient(to bottom, #007bc6, #0071b8);
  285. text-shadow: 0 1px hsla(0, 0%, 0%, 0.5);
  286. }
  287. .form-actions .dropbutton-multiple.open .dropbutton-widget {
  288. background-image: -webkit-linear-gradient(top, #007bc6, #0071b8);
  289. background-image: linear-gradient(to bottom, #007bc6, #0071b8);
  290. }
  291. .js .form-actions .dropbutton-wrapper .dropbutton-widget .dropbutton-action .button:hover,
  292. .js .form-actions .dropbutton-wrapper .dropbutton-widget .dropbutton-action .button:focus {
  293. color: #fff;
  294. background-color: #2369a6;
  295. background-image: -webkit-linear-gradient(top, #0c97ed, #1f86c7);
  296. background-image: linear-gradient(to bottom, #0c97ed, #1f86c7);
  297. box-shadow: 0 1px 2px hsla(203, 10%, 10%, 0.25);
  298. }
  299. .js .form-actions .dropbutton-wrapper .dropbutton-widget .dropbutton-action .button:active {
  300. border-color: #144b78;
  301. background-image: -webkit-linear-gradient(top, #08639b, #0071b8);
  302. background-image: linear-gradient(to bottom, #08639b, #0071b8);
  303. box-shadow: inset 0 1px 3px hsla(0, 0%, 0%, 0.2);
  304. }
  305. .js .form-actions .dropbutton-wrapper .dropbutton-widget .dropbutton-toggle button,
  306. .form-actions .dropbutton .secondary-action {
  307. border-color: #1e5c90;
  308. }
  309. .js .form-actions .dropbutton-wrapper .dropbutton-widget .dropbutton-toggle button {
  310. background-image: -webkit-linear-gradient(top, #007bc6, #0071b8);
  311. background-image: linear-gradient(to bottom, #007bc6, #0071b8);
  312. }
  313. .js .form-actions .dropbutton-wrapper .dropbutton-widget .dropbutton-toggle button:hover,
  314. .js .form-actions .dropbutton-wrapper .dropbutton-widget .dropbutton-toggle button:focus {
  315. background-color: #2369a6;
  316. background-image: -webkit-linear-gradient(top, #0c97ed, #1f86c7);
  317. background-image: linear-gradient(to bottom, #0c97ed, #1f86c7);
  318. }
  319. .js .form-actions .dropbutton-wrapper .dropbutton-widget .dropbutton-toggle button:active {
  320. border-color: #144b78;
  321. background-image: -webkit-linear-gradient(top, #08639b, #0071b8);
  322. background-image: linear-gradient(to bottom, #08639b, #0071b8);
  323. box-shadow: inset 0 1px 3px hsla(0, 0%, 0%, 0.2);
  324. }
  325. .form-actions .dropbutton-arrow {
  326. border-top-color: #fff;
  327. }
  328. .form-actions .dropbutton-multiple.open .dropbutton-arrow {
  329. border-bottom: 0.3333em solid white;
  330. }

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