-
Notifications
You must be signed in to change notification settings - Fork 5
/
_core.scss
74 lines (66 loc) · 2.48 KB
/
_core.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
// See LICENSE in the project root for license information.
// ---------------------------------------------------------------------
@import "libSupport/manageScope";
$focus: null !default;
// sass-lint:disable no-important
/// Global selector to address box-model and default `:focus` pseudo elements.
///
/// Global media setting for [a11y support of reduced-motion](https://twitter.com/nathansmith/status/1242606456677040128)
///
/// [Manage](/#scope-prefix-variable) `$scope` option.
/// @group core
/// @example scss - Default selector(s)
/// *, *:before, *:after {}
///
/// @example scss - Selector(s) when $scope: true;
/// .auro *, .auro *:before, .auro *:after {}
///
/// @example scss - import file
/// @import "./node_modules/@alaskaairux/webcorestylesheets/dist/core";
///
/// @example scss - import file with `$focus` set to `true`
/// $focus: true;
/// @import "./node_modules/@alaskaairux/webcorestylesheets/dist/core";
///
#{$scope} * {
&,
&:before,
&:after {
box-sizing: border-box;
@media (prefers-reduced-motion: reduce) {
animation: none !important;
transition: none !important;
}
}
// if $focus is true, override the default focus outline
@if $focus {
&:focus {
outline: 2px solid var(--auro-color-ui-default-on-light);
}
}
}
/// Selector to remove default focus styles when the [focus visible](https://www.npmjs.com/package/focus-visible) polyfill is loaded and the
/// focus-visible class is not applied to the element. Usually this means the user is clicking the element instead of tabbing to it.
///
/// This can eventually be removed once all browsers support `:focus-visible`.
///
/// @example scss - import file
/// @import "./node_modules/@alaskaairux/webcorestylesheets/dist/core";
///
/// @group Accessibility
.js-focus-visible :focus:not(.focus-visible) {
// Only visible when Windows High-Contrast Mode is turned on
outline: 3px solid transparent;
}
/// Selector to remove default focus styles when the :focus-visible pseudo-selector does not apply. Usually this means the user is clicking the element instead of tabbing to it.
///
/// Check current browser support for :focus-visible on [Can I Use](https://caniuse.com/css-focus-visible).
///
/// @example scss - import file
/// @import "./node_modules/@alaskaairux/webcorestylesheets/dist/core";
///
/// @group Accessibility
:focus:not(:focus-visible) {
outline: 3px solid transparent;
}