UNPKG

@telekom/scale-components

Version:

Scale is the digital design system for Telekom products and experiences.

112 lines (97 loc) 2.94 kB
/** * @license * Scale https://github.com/telekom/scale * * Copyright (c) 2021 Egor Kirpichev and contributors, Deutsche Telekom AG * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ :host { --border-bottom-color: var(--telekom-color-ui-faint); --border-left-color-third-nesting: var(--telekom-color-ui-strong); --color-active: var(--telekom-color-text-and-icon-primary-pressed); --color-hover: var(--telekom-color-text-and-icon-primary-hovered); --color-primary: var(--telekom-color-text-and-icon-primary-standard); --background-color-before-active: var(--color-primary); --font-bold: var(--telekom-text-style-ui-bold); --box-shadow-focus: inset 0 0 0 var(--telekom-line-weight-highlight) var(--telekom-color-functional-focus-standard); } .sidebar-nav-item { border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: var(--border-bottom-color); } .sidebar-nav-item--active { position: relative; color: var(--color-primary); } .sidebar-nav-item--active::before { content: ''; display: block; position: absolute; top: 0; left: var(--left-current-border, 0); width: 0; /* The transparent border makes the 2px */ height: 100%; background-color: var(--background-color-before-active); /* Accessibility: extra transparent line for Windows HCM */ border-left: 2px solid transparent; } /*:host([nesting-level='3']) .sidebar-nav-item--active::before { transform: translateX(-0.5px); }*/ .sidebar-nav-item:hover.sidebar-nav-item--active::before { background-color: var(--color-hover); } .sidebar-nav-item:active.sidebar-nav-item--active::before { background-color: var(--color-active); } .sidebar-nav-item--condensed.sidebar-nav-item--active::before { left: -1px; } :host([nesting-level='1']) .sidebar-nav-item, .sidebar-nav-item--bold { font: var(--font-bold); } :host([nesting-level='3']) .sidebar-nav-item { border-left-color: var(--border-left-color-third-nesting); border-left-style: solid; border-left-width: 0.0625rem; } ::slotted(a) { color: currentColor; display: flex; align-items: center; padding-top: 1rem; padding-right: 1rem; padding-bottom: 1rem; padding-left: var(--spacing-indent); border-radius: var(--telekom-radius-small); text-decoration: none; outline: none; min-height: 20px; } :host([nesting-level='2']) ::slotted(a) { padding-left: calc(var(--spacing-indent) + 0.75rem); } ::slotted(a:hover) { color: var(--color-hover); } ::slotted(a:focus) { box-shadow: var(--box-shadow-focus); } ::slotted(a:active) { color: var(--color-active); } .sidebar-nav-item--condensed { border-bottom-width: 0; } .sidebar-nav-item--condensed ::slotted(a) { padding-top: 0.5rem; padding-left: 0.75rem; padding-right: 0.5rem; padding-bottom: 0.5rem; }