-
Notifications
You must be signed in to change notification settings - Fork 17
/
valid.scss
172 lines (142 loc) · 3.24 KB
/
valid.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
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
@forward "something";
@use "base";
@use "sass:list";
@use "sass:map";
@use "sass:math";
@use "sass:meta";
@use "sass:string";
@import "something-else";
// Multi-line double-slash comment
// comment
@function remove-where($list, $condition) {
$new-list: ();
$separator: list.separator($list);
@each $element in $list {
@if not meta.call($condition, $element) {
$new-list: list.append($new-list, $element, $separator: $separator);
}
}
@return $new-list;
}
@function -private-function() {
@return true;
}
@mixin corner-icon($name, $top-or-bottom, $left-or-right) {
.icon-#{$name} {
background-image: url("/icons/#{$name}.svg");
position: absolute;
#{$top-or-bottom}: 0;
#{$left-or-right}: 0;
}
}
@mixin triangle($size, $color, $direction) {
border-color: transparent;
border-style: solid;
border-width: math.div($size, 2);
@if $direction == up {
border-bottom-color: $color;
} @else if $direction == right {
border-left-color: $color;
} @else if $direction == down {
border-top-color: $color;
} @else if $direction == left {
border-right-color: $color;
} @else {
@error "Unknown direction #{$direction}.";
}
}
@mixin theme($theme: DarkGray) {
background: $theme;
box-shadow: 0 0 1px rgb($theme / 25%);
}
@mixin -private-mixin() {
border: 1px;
}
%message-shared {
border: 1px solid #ccc;
color: #333;
}
%-private-placeholder {
border: 1px;
}
$-private-size: 10rem;
$local-color: #333;
$fonts: "Tahoma", "Helvetica Neue", "Helvetica", sans-serif;
$theme-colors: (
"success": #28a745,
"warning": #ffc107,
);
:root {
--brand-red: hsl(5deg 10% 40%);
}
.selector-1,
.selector-3[type="text"] {
background: linear-gradient(#fff, rgb(0 0 0 / 80%));
color: base.$primary-color;
top: calc(100% - 2rem) !important;
a {
width: math.div(300px, 960px) * 100%;
}
}
.selector-x { width: 10%; }
.selector-y { width: 20%; }
.selector-z { width: 30%; }
.selector-a {
@include theme;
}
.selector-b {
@extend %message-shared;
@include theme($theme: DarkRed);
}
/* Single-line comment */
@media (width >= 60em) {
.selector {
// Flush to parent comment
@include corner-icon("mail", top, left);
transform: translate(1, 1) scale(3);
}
}
@media (orientation: portrait), projection and (color) {
// Flush to parent double-slash comment
.selector-i + .selector-ii {
@include triangle(5px, black, right);
background: hsl(20deg 25% 33%);
.selector-j {
@function contains-helvetica($string) {
@return string.index($string, "Helvetica");
}
font-family: remove-where($fonts, meta.get-function("contains-helvetica"));
}
}
}
// Multi-line double-slash comment
// comment
@media
screen and (resolution >= 192dpi),
screen and (resolution >= 2dppx) {
.selector {
background-image:
repeating-linear-gradient(
-45deg,
transparent,
#fff 25px,
rgb(255 255 255 / 100%) 50px
);
height: 10rem;
}
/* Flush nested single line comment */
.selector::after {
background-color: map.get($theme-colors, "warning");
content: "→";
background-image: url("x.svg");
}
}
@keyframes fade-in {
from { opacity: 0; }
to { opacity: 1; }
}
$ratios:
5 4,
4 3,
3 2,
16 9;