diff options
Diffstat (limited to 'src/scopes/_links.scss')
-rw-r--r-- | src/scopes/_links.scss | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/src/scopes/_links.scss b/src/scopes/_links.scss new file mode 100644 index 0000000..69793b2 --- /dev/null +++ b/src/scopes/_links.scss | |||
@@ -0,0 +1,93 @@ | |||
1 | @use 'sass:map'; | ||
2 | @use 'sass:meta'; | ||
3 | @use 'iro-sass/src/iro-sass' as iro; | ||
4 | @use '../props'; | ||
5 | |||
6 | @forward 'links.vars'; | ||
7 | @use 'links.vars' as vars; | ||
8 | |||
9 | @mixin styles { | ||
10 | @include props.materialize(meta.module-variables('vars')); | ||
11 | |||
12 | @include iro.bem-scope('links') { | ||
13 | :link, | ||
14 | :visited { | ||
15 | color: currentColor; | ||
16 | text-decoration: underline; | ||
17 | text-decoration-thickness: props.get(vars.$underline-width); | ||
18 | text-decoration-color: props.get(vars.$underline-color); | ||
19 | border-radius: props.get(vars.$rounding); | ||
20 | box-decoration-break: clone; | ||
21 | |||
22 | &:hover { | ||
23 | text-decoration: underline; | ||
24 | text-decoration-skip-ink: none; | ||
25 | text-decoration-thickness: props.get(vars.$hover--underline-width); | ||
26 | } | ||
27 | |||
28 | &:focus-visible { | ||
29 | color: props.get(vars.$key-focus--text-color); | ||
30 | text-decoration: none; | ||
31 | outline: props.get(vars.$key-focus--border-color) solid props.get(vars.$key-focus--border-width); | ||
32 | box-shadow: | ||
33 | 0 | ||
34 | 0 | ||
35 | 0 | ||
36 | calc(props.get(vars.$key-focus--border-width) + props.get(vars.$key-focus--outline-width)) | ||
37 | props.get(vars.$key-focus--outline-color); | ||
38 | } | ||
39 | } | ||
40 | |||
41 | @include iro.bem-modifier('invisible') { | ||
42 | :link, | ||
43 | :visited { | ||
44 | text-decoration: none; | ||
45 | } | ||
46 | } | ||
47 | |||
48 | @include iro.bem-modifier('colored') { | ||
49 | :link { | ||
50 | color: props.get(vars.$colored--text-color); | ||
51 | text-decoration-color: props.get(vars.$colored--underline-color); | ||
52 | |||
53 | &:hover { | ||
54 | color: props.get(vars.$colored--hover--text-color); | ||
55 | } | ||
56 | } | ||
57 | |||
58 | :visited { | ||
59 | color: props.get(vars.$colored--visited--text-color); | ||
60 | text-decoration-color: props.get(vars.$colored--visited--underline-color); | ||
61 | |||
62 | &:hover { | ||
63 | color: props.get(vars.$colored--visited--hover--text-color); | ||
64 | } | ||
65 | } | ||
66 | } | ||
67 | |||
68 | @each $theme in map.keys(props.get(vars.$static-themes)) { | ||
69 | @include iro.bem-modifier($theme) { | ||
70 | :link, | ||
71 | :visited { | ||
72 | color: props.get(vars.$static-themes, $theme, --text-color); | ||
73 | text-decoration-color: props.get(vars.$static-themes, $theme, --underline-color); | ||
74 | |||
75 | &:hover { | ||
76 | color: props.get(vars.$static-themes, $theme, --hover, --text-color); | ||
77 | } | ||
78 | |||
79 | &:focus-visible { | ||
80 | color: props.get(vars.$static-themes, $theme, --key-focus, --text-color); | ||
81 | outline-color: props.get(vars.$static-themes, $theme, --key-focus, --border-color); | ||
82 | box-shadow: | ||
83 | 0 | ||
84 | 0 | ||
85 | 0 | ||
86 | calc(props.get(vars.$key-focus--border-width) + props.get(vars.$key-focus--outline-width)) | ||
87 | props.get(vars.$static-themes, $theme, --key-focus, --outline-color); | ||
88 | } | ||
89 | } | ||
90 | } | ||
91 | } | ||
92 | } | ||
93 | } | ||