Skip to content

Instantly share code, notes, and snippets.

@Pickra
Created April 26, 2023 14:11
Show Gist options
  • Save Pickra/1199f5f861c6d6e60b43386cbfa767ec to your computer and use it in GitHub Desktop.
Save Pickra/1199f5f861c6d6e60b43386cbfa767ec to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
@mixin pre-focus-styles {
outline: none;
transition: box-shadow 0.15s;
}
// Apply within :focus
@mixin focus-styles {
box-shadow: 0 0 0 2px var(--color-focusOutline), 0 0 0 6px var(--color-focusOutline-light);
}
// Shortcut for focus styles
@mixin focus {
@include pre-focus-styles;
&:focus {
@include focus-styles;
}
}
.modal {
&__close {
@include focus;
position: relative;
display: inline-flex;
float: right;
height: 2rem;
width: 2rem;
align-items: center;
justify-content: center;
padding: 0 var(--spacing-sm);
color: var(--color-button-subtle-text);
background-color: var(--color-button-subtle);
border-radius: var(--borderRadius-round);
border: 1px solid transparent;
cursor: pointer;
&:hover { background-color: var(--color-button-subtle-hovered); }
&:active { background-color: var(--color-button-subtle-pressed); }
}
}
.modal__close {
outline: none;
transition: box-shadow 0.15s;
position: relative;
display: inline-flex;
float: right;
height: 2rem;
width: 2rem;
align-items: center;
justify-content: center;
padding: 0 var(--spacing-sm);
color: var(--color-button-subtle-text);
background-color: var(--color-button-subtle);
border-radius: var(--borderRadius-round);
border: 1px solid transparent;
cursor: pointer;
}
.modal__close:focus {
box-shadow: 0 0 0 2px var(--color-focusOutline), 0 0 0 6px var(--color-focusOutline-light);
}
.modal__close:hover {
background-color: var(--color-button-subtle-hovered);
}
.modal__close:active {
background-color: var(--color-button-subtle-pressed);
}
{
"sass": {
"compiler": "dart-sass/1.32.12",
"extensions": {},
"syntax": "SCSS",
"outputStyle": "expanded"
},
"autoprefixer": false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment