media-library-vertical-tabs.css

Same filename and directory in other branches
  1. 11.x core/themes/default_admin/css/components/media-library-vertical-tabs.css
/*
 * DO NOT EDIT THIS FILE.
 * See the following change record for more information,
 * https://www.drupal.org/node/3084859
 * @preserve
 */

/*
 * @file
 * The vertical tabs within the media library that show when you're able to
 * add multiple types of media.
 */

.media-library-menu {
  position: relative;
  width: var(--vertical-tabs-menu-width);
  margin: 0;
  list-style: none;
  color: var(--color-text);
  border-color: var(--gin-border-color);
  background-color: var(--gin-bg-app);
}

.media-library-menu__item {
  margin: 0;
  padding: 0;

  &::before {
    z-index: var(--vertical-tabs-menu--z-index);
    /* 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. */
    display: block;
    width: 100%;
    margin-block-start: calc(var(--vertical-tabs-menu-separator-size) * -1);
    content: "";
    border-block-start: var(--vertical-tabs-menu-separator-size) solid var(--vertical-tabs-menu-separator-color);
  }

  /* On active items, extend by 1px to remove right border. */
  &:has(.media-library-menu__link.active) {
    width: calc(100% + 1px);
  }
}

/* Tab links within the vertical tabs. */

.media-library-menu__link {
  position: relative;
  display: block;
  margin-block-start: calc(var(--vertical-tabs-border-size) * -1);
  padding: var(--space-s);
  padding-inline-start: calc(var(--space-l) - var(--vertical-tabs-menu-link--active-border-size));
  -webkit-text-decoration: none;
  text-decoration: none;
  color: var(--gin-color-text);
  border: var(--vertical-tabs-border-size) solid var(--gin-border-color);
  border-inline-end-width: 0;
  border-inline-start-width: var(--vertical-tabs-menu-link--active-border-size);
  border-start-start-radius: var(--vertical-tabs-border-radius);
  border-end-start-radius: var(--vertical-tabs-border-radius);
  background-color: transparent;
  text-shadow: none;

  /* Menu link states. */
  &:focus {
    z-index: calc(var(--vertical-tabs-menu--z-index) + 3);
    /* 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. */
    -webkit-text-decoration: none;
    text-decoration: none;
    outline: 0;
  }

  &:hover {
    -webkit-text-decoration: none;
    text-decoration: none;
    color: var(--color-absolutezero);
    /* These borders are necessary to replace the dividing lines while in the hover state. */
    border-block: var(--vertical-tabs-menu-separator-size) solid var(--vertical-tabs-menu-separator-color);
    background: var(--color-bgblue-hover);
  }

  /* This pseudo element provides the background for the hover state. */
  &::before {
    position: absolute;
    z-index: calc(var(--vertical-tabs-menu--z-index) - 1);
    /* This should be on a lower level than the menu-item separator lines. */
    inset-block: calc(var(--vertical-tabs-border-size) * -1);
    inset-inline-start: calc(var(--vertical-tabs-menu-link--active-border-size) * -1);
    inset-inline-end: 0;
    content: "";
    pointer-events: none;
    background-clip: padding-box;
  }

  &:focus::after {
    position: absolute;
    inset: 0;
    margin-block: calc(var(--vertical-tabs-border-size) * -1);
    margin-inline: calc(var(--vertical-tabs-menu-link--active-border-size) * -1) 0;
    content: "";
    pointer-events: none;
    border: var(--gin-border-xs) solid var(--gin-color-focus);
    border-inline-end: 0;
    border-radius: var(--vertical-tabs-border-radius);
  }

  &.active {
    z-index: calc(var(--vertical-tabs-menu--z-index) + 2);
    /* The selected menu link should be on a higher level than the white masking line that hides the gray separator. */
    color: var(--color-absolutezero);
    border-color: var(--vertical-tabs-border-color) transparent;
    background-color: var(--color-white);
    box-shadow: var(--vertical-tabs-shadow);

    &:hover {
      color: var(--color-absolutezero-hover);
      background-color: var(--color-bgblue-hover);
    }

    &::before {
      z-index: 1;
      /* The blue active-tab indication should be on a higher level than the green focus border. */
      border-inline-start: var(--vertical-tabs-menu-link--active-border-size) solid var(--vertical-tabs-menu-link--active-border-color);
      border-inline-start-color: var(--gin-color-primary);
      border-start-start-radius: var(--base-border-radius);
      border-end-start-radius: var(--base-border-radius);
    }

    &:hover::before {
      background: none;
    }
  }

  /* Gin state overrides — must come after base states so source-order cascade wins. */
  &:active,
  &:hover,
  &:focus,
  &.active,
  &:hover:focus,
  &.active:hover,
  &.active:focus {
    color: var(--gin-color-primary);
    border-inline-end: 0 none;
    border-block-end: 1px solid var(--gin-border-color);
    background-color: var(--gin-bg-layer);
    box-shadow: none;
    text-shadow: none;
  }
}

File

core/themes/default_admin/css/components/media-library-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. * The vertical tabs within the media library that show when you're able to
  10. * add multiple types of media.
  11. */
  12. .media-library-menu {
  13. position: relative;
  14. width: var(--vertical-tabs-menu-width);
  15. margin: 0;
  16. list-style: none;
  17. color: var(--color-text);
  18. border-color: var(--gin-border-color);
  19. background-color: var(--gin-bg-app);
  20. }
  21. .media-library-menu__item {
  22. margin: 0;
  23. padding: 0;
  24. &::before {
  25. z-index: var(--vertical-tabs-menu--z-index);
  26. /* 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. */
  27. display: block;
  28. width: 100%;
  29. margin-block-start: calc(var(--vertical-tabs-menu-separator-size) * -1);
  30. content: "";
  31. border-block-start: var(--vertical-tabs-menu-separator-size) solid var(--vertical-tabs-menu-separator-color);
  32. }
  33. /* On active items, extend by 1px to remove right border. */
  34. &:has(.media-library-menu__link.active) {
  35. width: calc(100% + 1px);
  36. }
  37. }
  38. /* Tab links within the vertical tabs. */
  39. .media-library-menu__link {
  40. position: relative;
  41. display: block;
  42. margin-block-start: calc(var(--vertical-tabs-border-size) * -1);
  43. padding: var(--space-s);
  44. padding-inline-start: calc(var(--space-l) - var(--vertical-tabs-menu-link--active-border-size));
  45. -webkit-text-decoration: none;
  46. text-decoration: none;
  47. color: var(--gin-color-text);
  48. border: var(--vertical-tabs-border-size) solid var(--gin-border-color);
  49. border-inline-end-width: 0;
  50. border-inline-start-width: var(--vertical-tabs-menu-link--active-border-size);
  51. border-start-start-radius: var(--vertical-tabs-border-radius);
  52. border-end-start-radius: var(--vertical-tabs-border-radius);
  53. background-color: transparent;
  54. text-shadow: none;
  55. /* Menu link states. */
  56. &:focus {
  57. z-index: calc(var(--vertical-tabs-menu--z-index) + 3);
  58. /* 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. */
  59. -webkit-text-decoration: none;
  60. text-decoration: none;
  61. outline: 0;
  62. }
  63. &:hover {
  64. -webkit-text-decoration: none;
  65. text-decoration: none;
  66. color: var(--color-absolutezero);
  67. /* These borders are necessary to replace the dividing lines while in the hover state. */
  68. border-block: var(--vertical-tabs-menu-separator-size) solid var(--vertical-tabs-menu-separator-color);
  69. background: var(--color-bgblue-hover);
  70. }
  71. /* This pseudo element provides the background for the hover state. */
  72. &::before {
  73. position: absolute;
  74. z-index: calc(var(--vertical-tabs-menu--z-index) - 1);
  75. /* This should be on a lower level than the menu-item separator lines. */
  76. inset-block: calc(var(--vertical-tabs-border-size) * -1);
  77. inset-inline-start: calc(var(--vertical-tabs-menu-link--active-border-size) * -1);
  78. inset-inline-end: 0;
  79. content: "";
  80. pointer-events: none;
  81. background-clip: padding-box;
  82. }
  83. &:focus::after {
  84. position: absolute;
  85. inset: 0;
  86. margin-block: calc(var(--vertical-tabs-border-size) * -1);
  87. margin-inline: calc(var(--vertical-tabs-menu-link--active-border-size) * -1) 0;
  88. content: "";
  89. pointer-events: none;
  90. border: var(--gin-border-xs) solid var(--gin-color-focus);
  91. border-inline-end: 0;
  92. border-radius: var(--vertical-tabs-border-radius);
  93. }
  94. &.active {
  95. z-index: calc(var(--vertical-tabs-menu--z-index) + 2);
  96. /* The selected menu link should be on a higher level than the white masking line that hides the gray separator. */
  97. color: var(--color-absolutezero);
  98. border-color: var(--vertical-tabs-border-color) transparent;
  99. background-color: var(--color-white);
  100. box-shadow: var(--vertical-tabs-shadow);
  101. &:hover {
  102. color: var(--color-absolutezero-hover);
  103. background-color: var(--color-bgblue-hover);
  104. }
  105. &::before {
  106. z-index: 1;
  107. /* The blue active-tab indication should be on a higher level than the green focus border. */
  108. border-inline-start: var(--vertical-tabs-menu-link--active-border-size) solid var(--vertical-tabs-menu-link--active-border-color);
  109. border-inline-start-color: var(--gin-color-primary);
  110. border-start-start-radius: var(--base-border-radius);
  111. border-end-start-radius: var(--base-border-radius);
  112. }
  113. &:hover::before {
  114. background: none;
  115. }
  116. }
  117. /* Gin state overrides — must come after base states so source-order cascade wins. */
  118. &:active,
  119. &:hover,
  120. &:focus,
  121. &.active,
  122. &:hover:focus,
  123. &.active:hover,
  124. &.active:focus {
  125. color: var(--gin-color-primary);
  126. border-inline-end: 0 none;
  127. border-block-end: 1px solid var(--gin-border-color);
  128. background-color: var(--gin-bg-layer);
  129. box-shadow: none;
  130. text-shadow: none;
  131. }
  132. }

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