vertical-tabs.css

Same filename in this branch
  1. main core/misc/vertical-tabs.css
  2. main core/themes/olivero/css/components/vertical-tabs.css
  3. main core/themes/stable9/css/core/vertical-tabs.css
Same filename and directory in other branches
  1. 10 core/misc/vertical-tabs.css
  2. 10 core/themes/olivero/css/components/vertical-tabs.css
  3. 10 core/themes/stable9/css/core/vertical-tabs.css
  4. 10 core/themes/claro/css/components/vertical-tabs.css
  5. 11.x core/misc/vertical-tabs.css
  6. 11.x core/themes/olivero/css/components/vertical-tabs.css
  7. 11.x core/themes/stable9/css/core/vertical-tabs.css
  8. 11.x core/themes/claro/css/components/vertical-tabs.css
  9. 9 core/misc/vertical-tabs.css
  10. 9 core/themes/olivero/css/components/vertical-tabs.css
  11. 9 core/themes/stable9/css/core/vertical-tabs.css
  12. 9 core/themes/seven/css/components/vertical-tabs.css
  13. 9 core/themes/claro/css/components/vertical-tabs.css
  14. 9 core/themes/stable/css/core/vertical-tabs.css
  15. 8.9.x core/misc/vertical-tabs.css
  16. 8.9.x core/themes/seven/css/components/vertical-tabs.css
  17. 8.9.x core/themes/claro/css/components/vertical-tabs.css
  18. 8.9.x core/themes/stable/css/core/vertical-tabs.css
  19. 7.x misc/vertical-tabs.css
  20. 7.x themes/seven/vertical-tabs.css

Vertical tabs module.

Replaces /core/misc/vertical-tabs.css.

File

core/themes/claro/css/components/vertical-tabs.css

View source
  1. /*
  2. * DO NOT EDIT THIS FILE.
  3. * See the following change record for more information,
  4. * https://www.drupal.org/node/3084859
  5. * @preserve
  6. */
  7. /**
  8. * @file
  9. * Vertical tabs module.
  10. *
  11. * Replaces /core/misc/vertical-tabs.css.
  12. */
  13. /**
  14. * Main wrapper of vertical tabs.
  15. * This wrapper div is added by JavaScript.
  16. */
  17. .vertical-tabs {
  18. margin-block: var(--vertical-tabs-margin-vertical);
  19. border-block-start: 1px solid transparent; /* Need to hide the pane wrapper clearfix's height */
  20. }
  21. /**
  22. * Vertical tabs menu.
  23. */
  24. .vertical-tabs__menu {
  25. position: relative;
  26. display: block;
  27. float: left; /* LTR */
  28. width: var(--vertical-tabs-menu-width);
  29. margin: 0;
  30. padding-block-start: var(--vertical-tabs-menu-item-shadow-extraspace);
  31. list-style: none;
  32. color: var(--color-text);
  33. [dir="rtl"]
  34. }
  35. /**
  36. * Vertical tabs menu item.
  37. */
  38. .vertical-tabs__menu-item {
  39. overflow: hidden;
  40. margin-block: var(--vertical-tabs-menu-item--top-margin);
  41. margin-inline: var(--vertical-tabs-menu-item--left-margin) var(--vertical-tabs-menu-item--right-margin);
  42. padding-block: var(--vertical-tabs-menu-item-shadow-extraspace);
  43. padding-inline: var(--vertical-tabs-menu-item-shadow-extraspace) 0;
  44. }
  45. /**
  46. * These are the (gray) lines that are visually separating the vertical tab menu
  47. * items.
  48. */
  49. .vertical-tabs__menu-item::before,
  50. .vertical-tabs__menu-item::after {
  51. position: absolute;
  52. z-index: 1; /* The line should be kept above the vertical tabs menu link to keep it visible even if the link is hovered and gets the 'hover' background color. */
  53. display: block;
  54. width: 100%;
  55. margin-block-start: calc(var(--vertical-tabs-menu-separator-size) * -1);
  56. border-block-start: var(--vertical-tabs-menu-separator-size) solid var(--vertical-tabs-menu-separator-color);
  57. }
  58. /**
  59. * This pseudo element covers the gray separator line of the vertical tab menu
  60. * item that follows the active one.
  61. *
  62. * Without this, we would have a lightgray line at the bottom-left (LTR) corner
  63. * of the active vertical tab menu item.
  64. *
  65. * Let's call this 'masking' line.
  66. */
  67. .vertical-tabs__menu-item::after {
  68. z-index: 2;
  69. border-color: var(--color-white);
  70. }
  71. /**
  72. * Making the separator line visible only if it follows an unhidden menu item.
  73. */
  74. .vertical-tabs__menu-item:not(.vertical-tab--hidden) ~ .vertical-tabs__menu-item::before {
  75. content: "";
  76. }
  77. /* Menu item states. */
  78. .vertical-tabs__menu-item:focus {
  79. outline: 0;
  80. box-shadow: none;
  81. }
  82. .vertical-tabs__menu-item.is-selected::before,
  83. .vertical-tabs__menu-item:not(.vertical-tab--hidden) ~ .vertical-tabs__menu-item.is-selected::before {
  84. content: normal;
  85. }
  86. /* Make the white masking line displayed for the selected menu item. */
  87. .vertical-tabs__menu-item.is-selected::after {
  88. content: "";
  89. }
  90. /**
  91. * Anchor link inside the vertical tabs menu item.
  92. */
  93. .vertical-tabs__menu-link {
  94. position: relative;
  95. display: block;
  96. margin-block-start: calc(var(--vertical-tabs-border-size) * -1);
  97. padding: var(--space-s) var(--space-s) var(--space-s) calc(var(--space-l) - var(--vertical-tabs-menu-link--active-border-size));
  98. -webkit-text-decoration: none;
  99. text-decoration: none;
  100. color: var(--color-text);
  101. border: var(--vertical-tabs-border-size) solid transparent;
  102. border-block-width: var(--vertical-tabs-border-size);
  103. border-inline-width: var(--vertical-tabs-menu-link--active-border-size) 0;
  104. border-start-start-radius: var(--vertical-tabs-border-radius);
  105. border-start-end-radius: 0;
  106. border-end-end-radius: 0;
  107. border-end-start-radius: var(--vertical-tabs-border-radius);
  108. &:focus {
  109. z-index: 4; /* Focus state should be on the highest level to make the focus effect be fully visible. This also means that it should have bigger z-index than the selected link. */
  110. -webkit-text-decoration: none;
  111. text-decoration: none;
  112. box-shadow: none;
  113. &::after {
  114. position: absolute;
  115. inset: 0;
  116. margin: calc(var(--vertical-tabs-border-size) * -1) calc(var(--vertical-tabs-menu-link--active-border-size) * -1);
  117. content: "";
  118. pointer-events: none;
  119. border: var(--vertical-tabs-menu-link-focus-border-size) solid var(--color-focus);
  120. border-radius: var(--vertical-tabs-border-radius);
  121. }
  122. }
  123. &:hover {
  124. -webkit-text-decoration: none;
  125. text-decoration: none;
  126. color: var(--color-absolutezero);
  127. &::before {
  128. background: var(--color-bgblue-hover);
  129. }
  130. }
  131. &::before {
  132. position: absolute;
  133. z-index: 0; /* This should be on a lower level than the menu-item separator lines. */
  134. inset-block: calc(var(--vertical-tabs-border-size) * -1);
  135. inset-inline: calc(var(--vertical-tabs-menu-link--active-border-size) * -1) 0;
  136. content: "";
  137. pointer-events: none;
  138. background-clip: padding-box;
  139. }
  140. }
  141. .vertical-tabs__menu-item.is-selected .vertical-tabs__menu-link {
  142. z-index: 3; /* The selected menu link should be on a higher level than the white masking line that hides the gray separator. */
  143. color: var(--color-absolutezero);
  144. border-color: var(--vertical-tabs-border-color) transparent;
  145. background-color: var(--color-white);
  146. box-shadow: var(--vertical-tabs-shadow);
  147. }
  148. .vertical-tabs__menu-item.is-selected .vertical-tabs__menu-link:hover {
  149. color: var(--color-absolutezero-hover);
  150. background-color: var(--color-bgblue-hover);
  151. }
  152. .vertical-tabs__menu-item.is-selected .vertical-tabs__menu-link::before {
  153. z-index: 1; /* The blue active-tab indication should be on a higher level than the green focus border. */
  154. border-inline-start: var(--vertical-tabs-menu-link--active-border-size) solid var(--vertical-tabs-menu-link--active-border-color);
  155. border-radius: var(--base-border-radius) 0 0 var(--base-border-radius);
  156. border-start-start-radius: var(--base-border-radius);
  157. border-start-end-radius: 0;
  158. border-end-end-radius: 0;
  159. border-end-start-radius: var(--base-border-radius);
  160. @media (forced-colors: active) {
  161. border-inline-start: var(--vertical-tabs-menu-link--active-border-size) solid canvastext;
  162. }
  163. }
  164. .vertical-tabs__menu-item.is-selected .vertical-tabs__menu-link:hover::before {
  165. background: none;
  166. }
  167. .vertical-tabs__menu-link-content {
  168. position: relative;
  169. z-index: 1; /* We are using a pseudo element for displaying the hover state's background, and we have to keep the link content above that pseudo element. Without this, the text would be covered by the background. */
  170. }
  171. /**
  172. * Details summary in vertical tabs menu link and in the summary of the details.
  173. */
  174. .vertical-tabs__menu-link-summary {
  175. display: block;
  176. color: var(--color-gray-800);
  177. font-size: var(--font-size-s);
  178. font-weight: normal;
  179. }
  180. /**
  181. * Wrapper of vertical tabs panes.
  182. */
  183. .vertical-tabs__items {
  184. box-sizing: border-box;
  185. margin-block: var(--vertical-tabs-margin-vertical);
  186. color: var(--color-text);
  187. border: var(--vertical-tabs-border);
  188. border-radius: var(--vertical-tabs-border-radius);
  189. background-color: var(--color-white);
  190. box-shadow: var(--vertical-tabs-shadow);
  191. }
  192. /* This modifier is added by JavaScript (this is inherited from Drupal core). */
  193. .vertical-tabs__panes {
  194. position: relative;
  195. z-index: 1; /* The wrapper of the details of the vertical tabs should be on a higher level than the vertical tabs menu */
  196. inset-block-start: -1px;
  197. margin-block: 0;
  198. &::after {
  199. display: block; /* This clearfix makes the pane wrapper at least as tall as the menu. */
  200. clear: both;
  201. content: "";
  202. }
  203. }
  204. .vertical-tabs .vertical-tabs__panes {
  205. margin-inline-start: var(--vertical-tabs-menu-width);
  206. border-top-left-radius: 0;
  207. [dir="rtl"]
  208. }
  209. /**
  210. * The actual vertical tabs pane.
  211. *
  212. * This is a claro-details element which in this case is also
  213. * vertical-tabs__item.
  214. */
  215. .vertical-tabs__item {
  216. /* Render on top of the border of vertical-tabs__items. */
  217. margin: calc(var(--vertical-tabs-border-size) * -1) calc(var(--vertical-tabs-border-size) * -1) 0;
  218. border-radius: 0;
  219. &.first {
  220. border-top-left-radius: var(--details-accordion-border-size-radius);
  221. border-top-right-radius: var(--details-accordion-border-size-radius);
  222. }
  223. &.last {
  224. margin-bottom: calc(var(--vertical-tabs-border-size) * -1);
  225. border-bottom-right-radius: var(--details-accordion-border-size-radius);
  226. border-bottom-left-radius: var(--details-accordion-border-size-radius);
  227. }
  228. }
  229. .js .vertical-tabs .vertical-tabs__item {
  230. overflow: hidden;
  231. margin: 0;
  232. border: 0;
  233. &.first,
  234. &.last {
  235. border-radius: 0;
  236. }
  237. & > summary {
  238. display: none;
  239. }
  240. }

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