Skip to content

Commit ad114ee

Browse files
Implement core atom Link component CSS styles
GH-105
1 parent 5bee2fb commit ad114ee

File tree

1 file changed

+82
-0
lines changed

1 file changed

+82
-0
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
/*
2+
* Copyright (C) 2018-present Arctic Ice Studio <[email protected]>
3+
* Copyright (C) 2018-present Sven Greb <[email protected]>
4+
*
5+
* Project: Nord Docs
6+
* Repository: https://github.com/arcticicestudio/nord-docs
7+
* License: MIT
8+
*/
9+
10+
/**
11+
* @file Provides multiple styles for the `Link` component.
12+
* @author Arctic Ice Studio <[email protected]>
13+
* @author Sven Greb <[email protected]>
14+
* @since 0.5.0
15+
*/
16+
17+
import { css } from "styled-components";
18+
import { lighten, rgba } from "polished";
19+
20+
import { colors, themedMode, MODE_BRIGHT_SNOW_FLURRY, MODE_DARK_NIGHT_FROST } from "styles/theme";
21+
22+
const backgroundColorHover = themedMode({
23+
[MODE_BRIGHT_SNOW_FLURRY]: rgba(colors.nord6, 0.45),
24+
[MODE_DARK_NIGHT_FROST]: rgba(colors.nord3, 0.8)
25+
});
26+
27+
const fontColor = themedMode({
28+
[MODE_BRIGHT_SNOW_FLURRY]: colors.nord10,
29+
[MODE_DARK_NIGHT_FROST]: colors.nord8
30+
});
31+
32+
const fontColorDecent = themedMode({
33+
[MODE_BRIGHT_SNOW_FLURRY]: colors.nord0,
34+
[MODE_DARK_NIGHT_FROST]: lighten(0.2, colors.font.base[MODE_DARK_NIGHT_FROST])
35+
});
36+
37+
const fontColorHover = themedMode({
38+
[MODE_BRIGHT_SNOW_FLURRY]: colors.nord10
39+
});
40+
41+
const fontColorHoverMinimal = themedMode({
42+
[MODE_BRIGHT_SNOW_FLURRY]: colors.nord0,
43+
[MODE_DARK_NIGHT_FROST]: lighten(0.2, colors.font.base[MODE_DARK_NIGHT_FROST])
44+
});
45+
46+
const calmly = css`
47+
border-radius: 0.25em;
48+
color: ${fontColor};
49+
transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out;
50+
51+
&:hover,
52+
&:active,
53+
&:focus {
54+
background-color: ${backgroundColorHover};
55+
color: ${fontColorHover};
56+
}
57+
`;
58+
59+
const decent = css`
60+
border-bottom: 1px solid ${fontColor};
61+
color: ${fontColorDecent};
62+
transition: color 0.2s ease-in-out;
63+
64+
&:hover,
65+
&:active,
66+
&:focus {
67+
color: ${fontColor};
68+
}
69+
`;
70+
71+
const minimal = css`
72+
border-bottom: 1px solid ${fontColor};
73+
transition: border-bottom-color 0.2s ease-in-out;
74+
75+
&:hover,
76+
&:active,
77+
&:focus {
78+
border-bottom-color: ${fontColorHoverMinimal};
79+
}
80+
`;
81+
82+
export { calmly, decent, minimal };

0 commit comments

Comments
 (0)