media-library-vertical-tabs.pcss.css

Same filename and directory in other branches
  1. main core/themes/default_admin/css/components/media-library-vertical-tabs.pcss.css
/*
 * @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));
  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. */
    text-decoration: none;
    outline: 0;
  }

  &:hover {
    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.pcss.css

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

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