-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path_basic.scss
42 lines (40 loc) · 997 Bytes
/
_basic.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
@use 'sass:meta';
@use '../functions/numbers' as numb;
/// Styles for selected elements
/// @param {Color} $bg-color Background-color
/// @param {Color} $color Text-color
/// @param {String} $selector [*] Selector
/// @group Basic
/// @author Felix Scholze
/// @since v1.0.0
@mixin select-style($bg-color, $color, $selector: '*') {
@if meta.type-of($bg-color) != color {
@error '❌ ===> #{$bg-color} is not a color';
}
@if meta.type-of($color) != color {
@error '❌ ===> #{$color} is not a color';
}
#{$selector} {
&::selection {
background: $bg-color;
color: $color;
@content;
}
}
}
/// Adds an offset for the targeted link(s)
/// @param {Number} $offset the offset in any value
/// @group Basic
/// @author Felix Scholze
/// @since v1.0.0
@mixin target-anchor-offset($offset) {
:target {
&::before {
content: '';
display: block;
height: $offset;
margin-top: numb.number-invert($offset);
@content;
}
}
}