0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-29 18:09:19 -05:00
penpot/frontend/resources/styles/common/refactor/focus.scss
2023-11-15 09:42:40 +01:00

50 lines
1.1 KiB
SCSS

// 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/.
//
// Copyright (c) KALEIDOS INC
@mixin focusType($type) {
$realType: "";
@if $type {
$realType: $type + "-";
}
&:focus-visible {
outline: none;
background-color: var(--button-#{$realType}background-color-focus);
border: $s-1 solid var(--button-#{$realType}border-color-focus);
color: var(--button-#{$realType}foreground-color-focus);
svg,
span svg {
stroke: var(--button-#{$realType}foreground-color-focus);
}
}
}
@mixin focusPrimary {
@include focusType(primary);
}
@mixin focusSecondary {
@include focusType(secondary);
}
@mixin focusTertiary {
@include focusType(tertiary);
}
@mixin focusRadio {
@include focusType(radio);
}
@mixin focus {
@include focusType(null);
}
@mixin focusInput {
&:focus-within {
color: var(--input-foreground-color-active);
background-color: var(--input-background-color-active);
border: $s-1 solid var(--input-border-color-active);
}
}