Figma spec: [[ https://www.figma.com/design/IXJIBTXR4C7qj8bDp2dtRf/Credential-Management-UX-Specifications?node-id=28-6418&m=dev | https://www.figma.com/design/IXJIBTXR4C7qj8bDp2dtRf/Credential-Management-UX-Specifications?node-id=28-6418&m=dev ]] Differential Revision: https://phabricator.services.mozilla.com/D302404
169 lines
4.1 KiB
CSS
169 lines
4.1 KiB
CSS
/* 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 http://mozilla.org/MPL/2.0/. */
|
|
|
|
@import url("chrome://global/content/elements/moz-select.tokens.css");
|
|
|
|
:host {
|
|
--select-margin-block: var(--input-margin-block-adjust);
|
|
--select-margin-inline: var(--input-margin-inline-start-adjust) var(--space-small);
|
|
}
|
|
|
|
:host([inputlayout="inline-end"]) {
|
|
--select-margin-block: 0;
|
|
--select-margin-inline: 0;
|
|
}
|
|
|
|
.select-wrapper {
|
|
position: relative;
|
|
overflow: hidden;
|
|
display: flex;
|
|
align-items: center;
|
|
border: var(--select-border);
|
|
border-radius: var(--select-border-radius);
|
|
background-color: var(--select-background-color);
|
|
color: var(--select-text-color);
|
|
margin-block: var(--select-margin-block);
|
|
margin-inline: var(--select-margin-inline);
|
|
min-width: var(--select-min-width, none);
|
|
max-width: var(--select-max-width, none);
|
|
-moz-context-properties: fill;
|
|
fill: var(--select-icon-fill);
|
|
|
|
:host([invalid]) & {
|
|
border-color: var(--border-color-error);
|
|
}
|
|
|
|
&:hover,
|
|
&:has(select:open),
|
|
&:has(+ [open]) {
|
|
border-color: var(--select-border-color-hover);
|
|
background-color: var(--select-background-color-hover);
|
|
color: var(--select-text-color-hover);
|
|
}
|
|
|
|
&:has(> :disabled) {
|
|
border-color: var(--select-border-color-disabled);
|
|
background-color: var(--select-background-color-disabled);
|
|
color: var(--select-text-color-disabled);
|
|
opacity: var(--select-opacity-disabled);
|
|
}
|
|
|
|
&:has(:focus-visible) {
|
|
outline: var(--focus-outline);
|
|
outline-offset: var(--focus-outline-offset);
|
|
}
|
|
}
|
|
|
|
.panel-trigger {
|
|
display: flex;
|
|
align-items: center;
|
|
outline: none;
|
|
font-family: inherit;
|
|
margin-block-start: 0;
|
|
}
|
|
|
|
.panel-trigger-text {
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
}
|
|
|
|
panel-item[icon]::part(button) {
|
|
background-image: var(--select-item-icon-url);
|
|
}
|
|
|
|
panel-item[selected] {
|
|
background-color: var(--button-background-color-selected);
|
|
border-color: var(--button-border-color-selected);
|
|
color: var(--button-text-color-selected);
|
|
}
|
|
|
|
:host([size="small"]) {
|
|
select,
|
|
.panel-trigger {
|
|
padding-inline: var(--select-space-inline-small) calc(var(--select-space-inline-small) + var(--select-padding-icon) + var(--space-small));
|
|
min-height: var(--select-min-height-small);
|
|
font-size: var(--select-font-size-small);
|
|
}
|
|
|
|
.select-chevron-icon {
|
|
inset-inline-end: var(--select-space-inline-small);
|
|
}
|
|
|
|
.with-icon .panel-trigger {
|
|
padding-inline-start: calc(var(--select-space-inline-small) + var(--icon-size) + var(--space-small));
|
|
}
|
|
|
|
.with-icon:has(.panel-trigger) .select-option-icon {
|
|
inset-inline-start: var(--select-space-inline-small);
|
|
}
|
|
}
|
|
|
|
select,
|
|
.panel-trigger {
|
|
border-radius: var(--select-border-radius);
|
|
padding-inline: var(--select-space-inline) calc(var(--select-space-inline) + var(--select-padding-icon) + var(--space-small));
|
|
min-height: var(--select-min-height);
|
|
width: 100%;
|
|
font-size: var(--select-font-size);
|
|
font-weight: var(--select-font-weight);
|
|
background-color: transparent;
|
|
color: inherit;
|
|
appearance: none;
|
|
border: none;
|
|
}
|
|
|
|
select {
|
|
border: none;
|
|
padding-block: var(--select-padding-block);
|
|
margin: 0;
|
|
|
|
&:focus-visible {
|
|
outline: none;
|
|
outline-offset: unset;
|
|
}
|
|
|
|
& option {
|
|
font-weight: var(--select-option-font-weight);
|
|
color: var(--select-option-text-color);
|
|
|
|
&:disabled {
|
|
color: var(--text-color-disabled);
|
|
}
|
|
}
|
|
}
|
|
|
|
.select-option-icon,
|
|
.select-chevron-icon {
|
|
position: absolute;
|
|
width: var(--icon-size);
|
|
height: var(--icon-size);
|
|
pointer-events: none;
|
|
}
|
|
|
|
.select-option-icon {
|
|
inset-inline-start: var(--select-space-inline);
|
|
opacity: 0;
|
|
transform: scale(0);
|
|
transition:
|
|
opacity 0.3s ease,
|
|
transform 0.3s ease;
|
|
|
|
@media (prefers-reduced-motion) {
|
|
transition: unset;
|
|
}
|
|
}
|
|
|
|
.select-chevron-icon {
|
|
inset-inline-end: var(--select-space-inline);
|
|
}
|
|
|
|
.with-icon .panel-trigger {
|
|
padding-inline-start: calc(var(--select-space-inline) + var(--icon-size) + var(--space-small));
|
|
}
|
|
|
|
.with-icon:has(.panel-trigger) .select-option-icon {
|
|
opacity: 1;
|
|
transform: scale(1);
|
|
}
|