summaryrefslogtreecommitdiffstats
path: root/src/scopes/_invisible-links.scss
blob: 32e8e7ccabd97d968597303cc16abe1098ab0b10 (plain) (blame)
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
@use 'iro-sass/src/index' as iro;
@use '../functions' as fn;

@include iro.props-namespace('invisible-links') {
    @include iro.props-store((
        --colors: (
            --key-focus: (
                --border: fn.global-color(--focus --fill),
                --shadow: 0 0 0 calc(fn.global-dim(--focus --outline-width) + 2px) fn.global-color(--accent --primary --quiet --bg),
            ),
        )
    ), 'colors');

    @include iro.bem-scope(iro.props-namespace()) {
        :link,
        :visited {
            border-radius:   .5px;
            color:           currentColor;
            text-decoration: none;

            &:hover {
                text-decoration: underline;
            }

            @include iro.bem-at-theme('keyboard') {
                &:focus {
                    box-shadow: 0 0 0 2px fn.color(--key-focus --border), fn.color(--key-focus --shadow);
                }
            }
        }
    }
}