tabs.css

/*
 * DO NOT EDIT THIS FILE.
 * See the following change record for more information,
 * https://www.drupal.org/node/3084859
 * @preserve
 */

/**
 * Tabs.
 */

:root {
  /**
  * Tabs.
  */
  /* 48px */
  /* 40px */
}

.tabs-wrapper > nav {
  width: 100%;
}

.tabs {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0 0 1.5rem 0;
  border: 1px solid #d3d4d9;
  border-radius: 2px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

[dir="rtl"] .tabs {
  margin: 0 0 1.5rem 0;
}

.tabs__tab {
  position: relative;
  border-bottom: 1px solid #d3d4d9;
  background-color: #f9faff;
  font-size: 0.889rem;
  font-weight: bold;
}

.tabs__tab:last-child {
  border-bottom: 0;
}

.tabs__tab.is-active {
  display: flex;
  justify-content: space-between;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tabs__link {
  position: relative;
  display: flex;
  overflow: hidden;
  flex-grow: 1;
  align-items: center;
  box-sizing: border-box;
  min-height: 3rem;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  color: #55565b;
  line-height: 1.2rem;
}

.tabs__link:focus {
  min-height: calc(3.1875rem - 1px);
  margin: -1px;
  padding-left: calc(1.3125rem + 1px); /* LTR */
  text-decoration: none;
  color: #55565b;
  border: 3px solid #26a769;
  border-radius: 2px;
  outline: none;
  box-shadow: none;
}

[dir="rtl"] .tabs__link:focus {
  padding-right: calc(1.3125rem + 1px);
  padding-left: 1.5rem;
}

.tabs__link:hover {
  text-decoration: none;
  color: #232429;
}

.tabs__link.is-active {
  z-index: 1;
  flex-grow: 1;
  color: #003ecc;
}

.tabs__link.is-active:focus {
  margin: -1px 0;
  padding-right: 1.5rem;
  padding-left: 1.5rem;
  border-left: none; /* LTR */
  border-radius: 0;
}

.tabs__link:not(.is-active):focus {
  z-index: 3;
}

[dir="rtl"] .tabs__link.is-active:focus {
  border-right: none;
  border-left: 3px solid #26a769;
}

.tabs__link.is-active:hover {
  color: #232429;
}

/* Active and hover indicator. */

.tabs__tab::before,
.tabs__link::before {
  position: absolute;
  display: block;
  content: "";
}

.tabs__tab.is-active::before {
  z-index: 2;
  top: -1px;
  left: -1px; /* LTR */
  width: 0.1875rem;
  height: calc(100% + 2px);
  border-left: 3px solid #003ecc; /* LTR */
  border-top-left-radius: 2px; /* LTR */
}

[dir="rtl"] .tabs__tab.is-active::before {
  right: -1px;
  left: auto;
  border-right: 3px solid #003ecc;
  border-left: none;
  border-radius: 0 2px 0 2px;
}

.tabs.is-open .tabs__tab.is-active::before {
  border-bottom-left-radius: 0; /* LTR */
}

[dir="rtl"] .tabs.is-open .tabs__tab.is-active::before {
  border-bottom-right-radius: 2px;
}

.tabs__tab.is-active:focus::before {
  top: -0.1875rem;
  height: calc(3rem + 2px);
}

.tabs__tab:not(.is-active) {
  display: none;
}

.tabs--secondary .tabs__tab:not(.is-active) {
  display: block;
}

.tabs.is-open > .tabs__tab {
  display: flex;
}

.tabs__trigger {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 3rem;
  padding-right: 1px;
  text-align: center;
  border-left: 1px solid rgba(216, 217, 224, 0.8); /* LTR */
}

[dir="rtl"] .tabs__trigger {
  border-right: 1px solid rgba(216, 217, 224, 0.8);
  border-left: none;
}

.tabs__trigger:focus {
  padding-right: 0;
  border: 3px solid #26a769;
  border-radius: 2px;
  box-shadow: none;
}

@media screen and (min-width: 48em) {
  .tabs-wrapper {
    display: flex;
  }

  .tabs-wrapper--secondary {
    position: relative;
  }

  .is-horizontal .tabs {
    flex-direction: row;
    width: auto;
    margin: 0;
    border: 0;
    box-shadow: none;
  }

  .is-horizontal .tabs--secondary {
    overflow: hidden;
    margin: -0.375rem -0.375rem 0;
    padding: 0.375rem 0.375rem 0;
    border-radius: 0;
  }

  .is-horizontal .tabs--secondary .tabs__tab {
    font-size: 0.889rem;
  }

  .is-horizontal .tabs--secondary .tabs__link {
    min-height: 2.5rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  .is-horizontal .tabs--secondary .tabs__link:focus {
    min-height: 2.5rem;
  }

  .is-horizontal .tabs--secondary::after {
    position: absolute;
    bottom: 0;
    left: 0;
    display: block;
    width: 100%;
    content: "";
    border-bottom: 1px solid #d3d4d9;
  }

  .is-horizontal .tabs__tab {
    border-top: none;
    border-bottom: none;
    background: none;
    font-size: 1rem;
  }

  .is-horizontal .tabs__tab.is-active {
    order: 0;
    background: none;
    box-shadow: none;
  }
  .is-horizontal .tabs__tab.is-active::before {
    content: none;
  }
  .is-horizontal .tabs__tab .tabs__link.is-active::before {
    border-radius: 0;
  }
  .is-horizontal .tabs__trigger {
    display: none;
  }
  .is-horizontal .tabs__tab {
    display: block;
  }

  .is-horizontal .tabs__link {
    padding-right: 2rem;
    padding-left: 2rem;
    border-radius: 2px 2px 0 0;
  }

  .is-horizontal .tabs__link:focus {
    min-height: 3rem;
    margin: 0;
    padding-right: 2rem;
    padding-left: 2rem;
    color: #232429;
    border: none;
    border-radius: 2px 2px 0 0;
    outline: 2px dotted transparent;
    box-shadow: 0 0 0 2px #fff, 0 0 0 5px #26a769;
  }
  [dir="rtl"] .is-horizontal .tabs__link:focus {
    border: none;
  }
  .is-horizontal .tabs--primary .tabs__link:focus {
    box-shadow: 0 0 0 2px #f3f4f9, 0 0 0 5px #26a769;
  }

  .is-horizontal .tabs__link:hover {
    color: #0036b1;
    background: #e5edff;
  }

  .is-horizontal .tabs__link.is-active::before {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0.1875rem;
    border-right: none;
    border-bottom: 3px solid #003ecc;
    border-left: none;
  }
}

File

core/themes/claro/css/components/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. * Tabs.
  9. */
  10. :root {
  11. /**
  12. * Tabs.
  13. */
  14. /* 48px */
  15. /* 40px */
  16. }
  17. .tabs-wrapper > nav {
  18. width: 100%;
  19. }
  20. .tabs {
  21. display: flex;
  22. flex-direction: column;
  23. width: 100%;
  24. margin: 0 0 1.5rem 0;
  25. border: 1px solid #d3d4d9;
  26. border-radius: 2px;
  27. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  28. }
  29. [dir="rtl"] .tabs {
  30. margin: 0 0 1.5rem 0;
  31. }
  32. .tabs__tab {
  33. position: relative;
  34. border-bottom: 1px solid #d3d4d9;
  35. background-color: #f9faff;
  36. font-size: 0.889rem;
  37. font-weight: bold;
  38. }
  39. .tabs__tab:last-child {
  40. border-bottom: 0;
  41. }
  42. .tabs__tab.is-active {
  43. display: flex;
  44. justify-content: space-between;
  45. background-color: #fff;
  46. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  47. }
  48. .tabs__link {
  49. position: relative;
  50. display: flex;
  51. overflow: hidden;
  52. flex-grow: 1;
  53. align-items: center;
  54. box-sizing: border-box;
  55. min-height: 3rem;
  56. padding: 0.75rem 1.5rem;
  57. text-decoration: none;
  58. color: #55565b;
  59. line-height: 1.2rem;
  60. }
  61. .tabs__link:focus {
  62. min-height: calc(3.1875rem - 1px);
  63. margin: -1px;
  64. padding-left: calc(1.3125rem + 1px); /* LTR */
  65. text-decoration: none;
  66. color: #55565b;
  67. border: 3px solid #26a769;
  68. border-radius: 2px;
  69. outline: none;
  70. box-shadow: none;
  71. }
  72. [dir="rtl"] .tabs__link:focus {
  73. padding-right: calc(1.3125rem + 1px);
  74. padding-left: 1.5rem;
  75. }
  76. .tabs__link:hover {
  77. text-decoration: none;
  78. color: #232429;
  79. }
  80. .tabs__link.is-active {
  81. z-index: 1;
  82. flex-grow: 1;
  83. color: #003ecc;
  84. }
  85. .tabs__link.is-active:focus {
  86. margin: -1px 0;
  87. padding-right: 1.5rem;
  88. padding-left: 1.5rem;
  89. border-left: none; /* LTR */
  90. border-radius: 0;
  91. }
  92. .tabs__link:not(.is-active):focus {
  93. z-index: 3;
  94. }
  95. [dir="rtl"] .tabs__link.is-active:focus {
  96. border-right: none;
  97. border-left: 3px solid #26a769;
  98. }
  99. .tabs__link.is-active:hover {
  100. color: #232429;
  101. }
  102. /* Active and hover indicator. */
  103. .tabs__tab::before,
  104. .tabs__link::before {
  105. position: absolute;
  106. display: block;
  107. content: "";
  108. }
  109. .tabs__tab.is-active::before {
  110. z-index: 2;
  111. top: -1px;
  112. left: -1px; /* LTR */
  113. width: 0.1875rem;
  114. height: calc(100% + 2px);
  115. border-left: 3px solid #003ecc; /* LTR */
  116. border-top-left-radius: 2px; /* LTR */
  117. }
  118. [dir="rtl"] .tabs__tab.is-active::before {
  119. right: -1px;
  120. left: auto;
  121. border-right: 3px solid #003ecc;
  122. border-left: none;
  123. border-radius: 0 2px 0 2px;
  124. }
  125. .tabs.is-open .tabs__tab.is-active::before {
  126. border-bottom-left-radius: 0; /* LTR */
  127. }
  128. [dir="rtl"] .tabs.is-open .tabs__tab.is-active::before {
  129. border-bottom-right-radius: 2px;
  130. }
  131. .tabs__tab.is-active:focus::before {
  132. top: -0.1875rem;
  133. height: calc(3rem + 2px);
  134. }
  135. .tabs__tab:not(.is-active) {
  136. display: none;
  137. }
  138. .tabs--secondary .tabs__tab:not(.is-active) {
  139. display: block;
  140. }
  141. .tabs.is-open > .tabs__tab {
  142. display: flex;
  143. }
  144. .tabs__trigger {
  145. display: flex;
  146. flex-shrink: 0;
  147. align-items: center;
  148. justify-content: center;
  149. width: 3rem;
  150. padding-right: 1px;
  151. text-align: center;
  152. border-left: 1px solid rgba(216, 217, 224, 0.8); /* LTR */
  153. }
  154. [dir="rtl"] .tabs__trigger {
  155. border-right: 1px solid rgba(216, 217, 224, 0.8);
  156. border-left: none;
  157. }
  158. .tabs__trigger:focus {
  159. padding-right: 0;
  160. border: 3px solid #26a769;
  161. border-radius: 2px;
  162. box-shadow: none;
  163. }
  164. @media screen and (min-width: 48em) {
  165. .tabs-wrapper {
  166. display: flex;
  167. }
  168. .tabs-wrapper--secondary {
  169. position: relative;
  170. }
  171. .is-horizontal .tabs {
  172. flex-direction: row;
  173. width: auto;
  174. margin: 0;
  175. border: 0;
  176. box-shadow: none;
  177. }
  178. .is-horizontal .tabs--secondary {
  179. overflow: hidden;
  180. margin: -0.375rem -0.375rem 0;
  181. padding: 0.375rem 0.375rem 0;
  182. border-radius: 0;
  183. }
  184. .is-horizontal .tabs--secondary .tabs__tab {
  185. font-size: 0.889rem;
  186. }
  187. .is-horizontal .tabs--secondary .tabs__link {
  188. min-height: 2.5rem;
  189. padding-top: 0.5rem;
  190. padding-bottom: 0.5rem;
  191. }
  192. .is-horizontal .tabs--secondary .tabs__link:focus {
  193. min-height: 2.5rem;
  194. }
  195. .is-horizontal .tabs--secondary::after {
  196. position: absolute;
  197. bottom: 0;
  198. left: 0;
  199. display: block;
  200. width: 100%;
  201. content: "";
  202. border-bottom: 1px solid #d3d4d9;
  203. }
  204. .is-horizontal .tabs__tab {
  205. border-top: none;
  206. border-bottom: none;
  207. background: none;
  208. font-size: 1rem;
  209. }
  210. .is-horizontal .tabs__tab.is-active {
  211. order: 0;
  212. background: none;
  213. box-shadow: none;
  214. }
  215. .is-horizontal .tabs__tab.is-active::before {
  216. content: none;
  217. }
  218. .is-horizontal .tabs__tab .tabs__link.is-active::before {
  219. border-radius: 0;
  220. }
  221. .is-horizontal .tabs__trigger {
  222. display: none;
  223. }
  224. .is-horizontal .tabs__tab {
  225. display: block;
  226. }
  227. .is-horizontal .tabs__link {
  228. padding-right: 2rem;
  229. padding-left: 2rem;
  230. border-radius: 2px 2px 0 0;
  231. }
  232. .is-horizontal .tabs__link:focus {
  233. min-height: 3rem;
  234. margin: 0;
  235. padding-right: 2rem;
  236. padding-left: 2rem;
  237. color: #232429;
  238. border: none;
  239. border-radius: 2px 2px 0 0;
  240. outline: 2px dotted transparent;
  241. box-shadow: 0 0 0 2px #fff, 0 0 0 5px #26a769;
  242. }
  243. [dir="rtl"] .is-horizontal .tabs__link:focus {
  244. border: none;
  245. }
  246. .is-horizontal .tabs--primary .tabs__link:focus {
  247. box-shadow: 0 0 0 2px #f3f4f9, 0 0 0 5px #26a769;
  248. }
  249. .is-horizontal .tabs__link:hover {
  250. color: #0036b1;
  251. background: #e5edff;
  252. }
  253. .is-horizontal .tabs__link.is-active::before {
  254. top: auto;
  255. right: 0;
  256. bottom: 0;
  257. left: 0;
  258. width: 100%;
  259. height: 0.1875rem;
  260. border-right: none;
  261. border-bottom: 3px solid #003ecc;
  262. border-left: none;
  263. }
  264. }

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