summaryrefslogtreecommitdiffstats
path: root/src/scopes/_implicit.scss
blob: cee16390977bd680bc1ae257c73b7b9d7f55db9d (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
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
@use 'sass:map';
@use 'sass:math';
@use 'sass:meta';
@use 'sass:string';
@use 'iro-sass/src/bem';
@use 'iro-sass/src/props';
@use '../props' as *;
@use '../core.vars' as core;

@forward 'implicit.vars';
@use 'implicit.vars' as vars;

@mixin styles {
	@include materialize-at-root(meta.module-variables('vars'));

	@layer scope {
		html {
			accent-color:    props.get(core.$theme, --accent, --600);
			scrollbar-color: props.get(core.$theme, --text-disabled) transparent;
		}

		body {
			padding:               0;
			margin:                0;
			font-family:           props.get(vars.$body--font-family);
			font-size:             props.get(vars.$body--font-size);
			font-feature-settings: props.get(vars.$body--feature-settings);
			line-height:           props.get(vars.$body--line-height);
			color:                 props.get(core.$theme, --text);
			background-color:      props.get(core.$theme, --bg-base);
		}

		pre,
		code {
			font-family:           props.get(vars.$code--font-family);
			font-size:             props.get(vars.$code--font-size);
			font-feature-settings: props.get(vars.$code--feature-settings);
			line-height:           props.get(vars.$code--line-height);
		}

		pre {
			margin:     0;
			overflow-x: auto;

			code {
				font-size: 1em;
				color:     currentColor;
			}
		}

		h1,
		h2,
		h3,
		h4,
		h5,
		h6 {
			margin-block:          props.get(vars.$heading--margin-bs) 0;
			font-family:           props.get(vars.$heading--font-family);
			font-size:             props.get(vars.$heading--font-size);
			font-weight:           props.get(vars.$heading--font-weight);
			font-feature-settings: props.get(vars.$heading--feature-settings);
			line-height:           props.get(vars.$heading--line-height);
			color:                 props.get(vars.$heading--color);

			& + & {
				margin-block-start: props.get(vars.$heading--margin-bs-sibling);
			}
		}

		p {
			margin-block: props.get(vars.$paragraph--margin-bs) 0;

			&:empty {
				display: none;
			}
		}

		strong {
			font-weight: bold;
		}

		small {
			font-size: props.get(vars.$small--font-size);
		}

		ul,
		ol {
			padding:    0;
			margin:     0;
			list-style: none;
		}

		li {
			padding: 0;
			margin:  0;
		}

		:focus,
		:focus-visible {
			outline: 0;
		}

		:link,
		:visited {
			color:           currentColor;
			text-decoration: none;
		}


		button,
		input,
		textarea {
			box-sizing:     content-box;
			padding:        0;
			margin:         0;
			font-family:    inherit;
			font-size:      1em;
			font-style:     inherit;
			font-weight:    inherit;
			line-height:    inherit;
			color:          currentColor;
			text-align:     inherit;
			text-transform: inherit;
			appearance:     none;
			background:     none;
			border:         0;

			&::-moz-focus-inner {
				border: 0;
			}
		}

		input,
		textarea {
			&::placeholder {
				color:   props.get(core.$theme, --text-mute);
				opacity: 1;
			}

			&:disabled {
				color: props.get(core.$theme, --text-disabled);
			}
		}

		textarea {
			block-size: calc(1em * props.get(core.$font--standard--line-height));
		}

		hr {
			block-size:       props.get(core.$border-width--thin);
			margin:           0;
			background-color: props.get(core.$theme, --border);
			border:           0;
		}

		figure {
			padding: 0;
			margin:  0;
		}

		@each $theme in map.keys(props.get(core.$transparent-colors)) {
			.t-static-#{string.slice($theme, 3)} {
				color: props.get(core.$transparent-colors, $theme, --800);

				h1,
				h2,
				h3,
				h4,
				h5,
				h6 {
					color: props.get(core.$transparent-colors, $theme, --900);
				}

				hr {
					color: props.get(core.$transparent-colors, $theme, --400);
				}
			}
		}
	}
}