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
- /*
- * @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;
- }
- }
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.