tabs.scss 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. .ol-tabs {
  2. --border-width-base: 3px;
  3. .nav-tabs-container {
  4. overflow-x: auto;
  5. display: flex;
  6. flex-direction: column;
  7. @include media-breakpoint-down(md) {
  8. display: block;
  9. }
  10. .nav-tabs {
  11. display: inline-flex;
  12. gap: var(--spacing-04);
  13. margin: 0 auto;
  14. padding: 0;
  15. border-bottom: var(--border-width-base) solid var(--border-divider);
  16. text-align: center;
  17. border-top: 2px solid transparent; // so that top focus border is visible
  18. min-width: max-content; // This is for horizontal scrolling
  19. li {
  20. display: inline-block;
  21. float: none;
  22. margin-bottom: calc(var(--border-width-base) * -0.6);
  23. &:last-child {
  24. margin-right: 0;
  25. }
  26. a,
  27. button {
  28. border: 0;
  29. border-radius: 0;
  30. color: var(--content-secondary);
  31. margin-right: unset;
  32. padding: var(--spacing-04);
  33. line-height: var(--line-height-03);
  34. text-decoration: none;
  35. &:focus,
  36. &:hover {
  37. border: 0;
  38. }
  39. &:focus,
  40. &:focus-visible {
  41. background-color: unset;
  42. outline: 0;
  43. }
  44. &:hover {
  45. background-color: var(--bg-light-secondary);
  46. text-decoration: none;
  47. }
  48. &:focus-visible {
  49. @include box-shadow-button-input;
  50. }
  51. }
  52. }
  53. li > a.active,
  54. li > button.active {
  55. background-color: transparent;
  56. border: 0;
  57. border-bottom: 3px solid var(--green-50);
  58. color: var(--content-primary);
  59. }
  60. &.align-left {
  61. margin-left: 0;
  62. margin-right: 0;
  63. }
  64. }
  65. }
  66. .tab-content {
  67. margin-top: var(--spacing-11);
  68. }
  69. }
  70. // Scroll the page up a bit to allow tab links to be shown when navigating to
  71. // a bookmarked tab hash
  72. [data-ol-bookmarkable-tabset] .tab-pane {
  73. scroll-margin-top: 120px;
  74. }