@nopon-web/styles 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_function.scss +21 -0
- package/_mixin.scss +44 -0
- package/_variables.scss +2 -0
- package/animation.scss +18 -0
- package/atomic.scss +60 -0
- package/base.scss +9 -0
- package/components/icon.scss +8 -0
- package/components/picture.scss +26 -0
- package/components/popup.scss +48 -0
- package/components/scroll-bar.scss +31 -0
- package/components/text.scss +8 -0
- package/components.scss +4 -0
- package/index.scss +2 -0
- package/normalize.css +378 -0
- package/package.json +15 -0
- package/theme.scss +159 -0
package/_function.scss
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
@use 'sass:string';
|
|
2
|
+
@use './_variables' as var;
|
|
3
|
+
|
|
4
|
+
@function get-image($image) {
|
|
5
|
+
// 已经是合法CSS值的情况
|
|
6
|
+
@if string.index($image, 'url(') or
|
|
7
|
+
string.index($image, 'gradient(') or
|
|
8
|
+
string.index($image, 'var(') or
|
|
9
|
+
string.index($image, 'data:')
|
|
10
|
+
{
|
|
11
|
+
@return $image;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// 空值或none
|
|
15
|
+
@if $image == none or $image == null {
|
|
16
|
+
@return none;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// 默认处理为路径
|
|
20
|
+
@return url($image);
|
|
21
|
+
}
|
package/_mixin.scss
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
@use './_variables' as var;
|
|
2
|
+
@use './_function' as func;
|
|
3
|
+
|
|
4
|
+
@mixin absolute-center($x: true, $y: true) {
|
|
5
|
+
position: absolute;
|
|
6
|
+
|
|
7
|
+
@if $y {
|
|
8
|
+
top: 50%;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@if $x {
|
|
12
|
+
left: 50%;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
transform: translate(#{if($x, '-50%', '0')}, #{if($y, '-50%', '0')});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@mixin set-z-index($number) {
|
|
19
|
+
z-index: calc(var(--z-index-base, var.$z-index-base) + $number);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// 背景
|
|
23
|
+
@mixin bg($w, $h, $image) {
|
|
24
|
+
width: $w;
|
|
25
|
+
height: $h;
|
|
26
|
+
background-size: 100% 100%;
|
|
27
|
+
background-repeat: no-repeat;
|
|
28
|
+
background-position: center;
|
|
29
|
+
background-image: func.get-image($image);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@mixin bg-border($width, $height, $image) {
|
|
33
|
+
min-width: $width;
|
|
34
|
+
height: $height;
|
|
35
|
+
border-image-source: func.get-image($image);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@mixin bg-text($image) {
|
|
39
|
+
background-clip: text;
|
|
40
|
+
-webkit-background-clip: text;
|
|
41
|
+
color: transparent;
|
|
42
|
+
-webkit-text-fill-color: transparent;
|
|
43
|
+
background-image: func.get-image($image);
|
|
44
|
+
}
|
package/_variables.scss
ADDED
package/animation.scss
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
@keyframes like-floating {
|
|
2
|
+
from {
|
|
3
|
+
transform: translateY(0) scale(0.5);
|
|
4
|
+
}
|
|
5
|
+
to {
|
|
6
|
+
transform: translateY(-180%) scale(1.5);
|
|
7
|
+
opacity: 0;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.animation {
|
|
12
|
+
&-like_floating {
|
|
13
|
+
animation-name: like-floating;
|
|
14
|
+
animation-duration: 1s;
|
|
15
|
+
animation-timing-function: ease-out;
|
|
16
|
+
animation-fill-mode: forwards;
|
|
17
|
+
}
|
|
18
|
+
}
|
package/atomic.scss
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// flex
|
|
2
|
+
.flex {
|
|
3
|
+
display: flex;
|
|
4
|
+
}
|
|
5
|
+
.flex-1 {
|
|
6
|
+
flex: 1 1 0%;
|
|
7
|
+
}
|
|
8
|
+
.flex-auto {
|
|
9
|
+
flex: 1 1 auto;
|
|
10
|
+
}
|
|
11
|
+
.flex-initial {
|
|
12
|
+
flex: 0 1 auto;
|
|
13
|
+
}
|
|
14
|
+
.flex-none {
|
|
15
|
+
flex: none;
|
|
16
|
+
}
|
|
17
|
+
.justify-normal {
|
|
18
|
+
justify-content: normal;
|
|
19
|
+
}
|
|
20
|
+
.justify-start {
|
|
21
|
+
justify-content: flex-start;
|
|
22
|
+
}
|
|
23
|
+
.justify-end {
|
|
24
|
+
justify-content: flex-end;
|
|
25
|
+
}
|
|
26
|
+
.justify-center {
|
|
27
|
+
justify-content: center;
|
|
28
|
+
}
|
|
29
|
+
.justify-between {
|
|
30
|
+
justify-content: space-between;
|
|
31
|
+
}
|
|
32
|
+
.justify-around {
|
|
33
|
+
justify-content: space-around;
|
|
34
|
+
}
|
|
35
|
+
.justify-evenly {
|
|
36
|
+
justify-content: space-evenly;
|
|
37
|
+
}
|
|
38
|
+
.justify-stretch {
|
|
39
|
+
justify-content: stretch;
|
|
40
|
+
}
|
|
41
|
+
.items-start {
|
|
42
|
+
align-items: flex-start;
|
|
43
|
+
}
|
|
44
|
+
.items-end {
|
|
45
|
+
align-items: flex-end;
|
|
46
|
+
}
|
|
47
|
+
.items-center {
|
|
48
|
+
align-items: center;
|
|
49
|
+
}
|
|
50
|
+
.items-baseline {
|
|
51
|
+
align-items: baseline;
|
|
52
|
+
}
|
|
53
|
+
.items-stretch {
|
|
54
|
+
align-items: stretch;
|
|
55
|
+
}
|
|
56
|
+
.text-overflow {
|
|
57
|
+
white-space: nowrap;
|
|
58
|
+
overflow: hidden;
|
|
59
|
+
text-overflow: ellipsis;
|
|
60
|
+
}
|
package/base.scss
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
@use '../mixin' as mixin;
|
|
2
|
+
|
|
3
|
+
// 图片
|
|
4
|
+
.picture {
|
|
5
|
+
position: relative;
|
|
6
|
+
|
|
7
|
+
img {
|
|
8
|
+
width: 100%;
|
|
9
|
+
height: 100%;
|
|
10
|
+
object-fit: contain;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.picture-content {
|
|
14
|
+
&--center {
|
|
15
|
+
@include mixin.absolute-center(true, true);
|
|
16
|
+
}
|
|
17
|
+
&--bottom {
|
|
18
|
+
@include mixin.absolute-center(true, false);
|
|
19
|
+
bottom: 0;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&:has(.picture-content) {
|
|
24
|
+
position: relative;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
@use '../_variables' as var;
|
|
2
|
+
|
|
3
|
+
.popup {
|
|
4
|
+
overflow: hidden;
|
|
5
|
+
|
|
6
|
+
&.no-scroll {
|
|
7
|
+
.popup-wrapper {
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
}
|
|
11
|
+
.popup-body {
|
|
12
|
+
flex: 1;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.popup-wrapper {
|
|
18
|
+
height: 100%;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.popup-header--title {
|
|
22
|
+
width: 100%;
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.popup-body {
|
|
29
|
+
position: relative;
|
|
30
|
+
overflow-y: scroll;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.popup-footer {
|
|
34
|
+
text-align: center;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.popup-footer--button_list {
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: flex-end;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// 自定义
|
|
43
|
+
.footer-custom {
|
|
44
|
+
position: sticky;
|
|
45
|
+
left: 0;
|
|
46
|
+
bottom: 0;
|
|
47
|
+
width: 100%;
|
|
48
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
.s-scroll {
|
|
2
|
+
&::-webkit-scrollbar {
|
|
3
|
+
display: none;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
&-bar {
|
|
7
|
+
&_x {
|
|
8
|
+
position: relative;
|
|
9
|
+
.s-scroll-bar_thumb {
|
|
10
|
+
position: absolute;
|
|
11
|
+
bottom: 0;
|
|
12
|
+
left: 0;
|
|
13
|
+
height: 6px;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&_y {
|
|
18
|
+
position: relative;
|
|
19
|
+
.s-scroll-bar_thumb {
|
|
20
|
+
position: absolute;
|
|
21
|
+
top: 0;
|
|
22
|
+
left: 0;
|
|
23
|
+
width: 100%;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&_thumb {
|
|
28
|
+
background-color: var(--theme-color);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
package/components.scss
ADDED
package/index.scss
ADDED
package/normalize.css
ADDED
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
|
|
2
|
+
|
|
3
|
+
/* Document
|
|
4
|
+
========================================================================== */
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 1. Correct the line height in all browsers.
|
|
8
|
+
* 2. Prevent adjustments of font size after orientation changes in iOS.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
html {
|
|
12
|
+
line-height: 1.15;
|
|
13
|
+
/* 1 */
|
|
14
|
+
-webkit-text-size-adjust: 100%;
|
|
15
|
+
/* 2 */
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* Sections
|
|
19
|
+
========================================================================== */
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Remove the margin in all browsers.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
body {
|
|
26
|
+
margin: 0;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Render the `main` element consistently in IE.
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
main {
|
|
34
|
+
display: block;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Correct the font size and margin on `h1` elements within `section` and
|
|
39
|
+
* `article` contexts in Chrome, Firefox, and Safari.
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
h1 {
|
|
43
|
+
margin: 0.67em 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* Grouping content
|
|
47
|
+
========================================================================== */
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* 1. Add the correct box sizing in Firefox.
|
|
51
|
+
* 2. Show the overflow in Edge and IE.
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
hr {
|
|
55
|
+
box-sizing: content-box;
|
|
56
|
+
/* 1 */
|
|
57
|
+
height: 0;
|
|
58
|
+
/* 1 */
|
|
59
|
+
overflow: visible;
|
|
60
|
+
/* 2 */
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* 1. Correct the inheritance and scaling of font size in all browsers.
|
|
65
|
+
* 2. Correct the odd `em` font sizing in all browsers.
|
|
66
|
+
*/
|
|
67
|
+
|
|
68
|
+
pre {
|
|
69
|
+
font-family: monospace, monospace;
|
|
70
|
+
/* 1 */
|
|
71
|
+
font-size: 1em;
|
|
72
|
+
/* 2 */
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* Text-level semantics
|
|
76
|
+
========================================================================== */
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Remove the gray background on active links in IE 10.
|
|
80
|
+
*/
|
|
81
|
+
|
|
82
|
+
a {
|
|
83
|
+
background-color: transparent;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* 1. Remove the bottom border in Chrome 57-
|
|
88
|
+
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
|
|
89
|
+
*/
|
|
90
|
+
|
|
91
|
+
abbr[title] {
|
|
92
|
+
border-bottom: none;
|
|
93
|
+
/* 1 */
|
|
94
|
+
text-decoration: underline;
|
|
95
|
+
/* 2 */
|
|
96
|
+
text-decoration: underline dotted;
|
|
97
|
+
/* 2 */
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Add the correct font weight in Chrome, Edge, and Safari.
|
|
102
|
+
*/
|
|
103
|
+
|
|
104
|
+
b,
|
|
105
|
+
strong {
|
|
106
|
+
font-weight: bolder;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* 1. Correct the inheritance and scaling of font size in all browsers.
|
|
111
|
+
* 2. Correct the odd `em` font sizing in all browsers.
|
|
112
|
+
*/
|
|
113
|
+
|
|
114
|
+
code,
|
|
115
|
+
kbd,
|
|
116
|
+
samp {
|
|
117
|
+
font-family: monospace, monospace;
|
|
118
|
+
/* 1 */
|
|
119
|
+
font-size: 1em;
|
|
120
|
+
/* 2 */
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Add the correct font size in all browsers.
|
|
125
|
+
*/
|
|
126
|
+
|
|
127
|
+
small {
|
|
128
|
+
font-size: 80%;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Prevent `sub` and `sup` elements from affecting the line height in
|
|
133
|
+
* all browsers.
|
|
134
|
+
*/
|
|
135
|
+
|
|
136
|
+
sub,
|
|
137
|
+
sup {
|
|
138
|
+
font-size: 75%;
|
|
139
|
+
line-height: 0;
|
|
140
|
+
position: relative;
|
|
141
|
+
vertical-align: baseline;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
sub {
|
|
145
|
+
bottom: -0.25em;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
sup {
|
|
149
|
+
top: -0.5em;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/* Embedded content
|
|
153
|
+
========================================================================== */
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Remove the border on images inside links in IE 10.
|
|
157
|
+
*/
|
|
158
|
+
|
|
159
|
+
img {
|
|
160
|
+
border-style: none;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/* Forms
|
|
164
|
+
========================================================================== */
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* 1. Change the font styles in all browsers.
|
|
168
|
+
* 2. Remove the margin in Firefox and Safari.
|
|
169
|
+
*/
|
|
170
|
+
|
|
171
|
+
button,
|
|
172
|
+
input,
|
|
173
|
+
optgroup,
|
|
174
|
+
select,
|
|
175
|
+
textarea {
|
|
176
|
+
font-family: inherit;
|
|
177
|
+
/* 1 */
|
|
178
|
+
font-size: 100%;
|
|
179
|
+
/* 1 */
|
|
180
|
+
line-height: 1.15;
|
|
181
|
+
/* 1 */
|
|
182
|
+
margin: 0;
|
|
183
|
+
/* 2 */
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Show the overflow in IE.
|
|
188
|
+
* 1. Show the overflow in Edge.
|
|
189
|
+
*/
|
|
190
|
+
|
|
191
|
+
button,
|
|
192
|
+
input {
|
|
193
|
+
/* 1 */
|
|
194
|
+
overflow: visible;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Remove the inheritance of text transform in Edge, Firefox, and IE.
|
|
199
|
+
* 1. Remove the inheritance of text transform in Firefox.
|
|
200
|
+
*/
|
|
201
|
+
|
|
202
|
+
button,
|
|
203
|
+
select {
|
|
204
|
+
/* 1 */
|
|
205
|
+
text-transform: none;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Correct the inability to style clickable types in iOS and Safari.
|
|
210
|
+
*/
|
|
211
|
+
|
|
212
|
+
button,
|
|
213
|
+
[type="button"],
|
|
214
|
+
[type="reset"],
|
|
215
|
+
[type="submit"] {
|
|
216
|
+
-webkit-appearance: button;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Remove the inner border and padding in Firefox.
|
|
221
|
+
*/
|
|
222
|
+
|
|
223
|
+
button::-moz-focus-inner,
|
|
224
|
+
[type="button"]::-moz-focus-inner,
|
|
225
|
+
[type="reset"]::-moz-focus-inner,
|
|
226
|
+
[type="submit"]::-moz-focus-inner {
|
|
227
|
+
border-style: none;
|
|
228
|
+
padding: 0;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Restore the focus styles unset by the previous rule.
|
|
233
|
+
*/
|
|
234
|
+
|
|
235
|
+
button:-moz-focusring,
|
|
236
|
+
[type="button"]:-moz-focusring,
|
|
237
|
+
[type="reset"]:-moz-focusring,
|
|
238
|
+
[type="submit"]:-moz-focusring {
|
|
239
|
+
outline: 1px dotted ButtonText;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Correct the padding in Firefox.
|
|
244
|
+
*/
|
|
245
|
+
|
|
246
|
+
fieldset {
|
|
247
|
+
padding: 0.35em 0.75em 0.625em;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* 1. Correct the text wrapping in Edge and IE.
|
|
252
|
+
* 2. Correct the color inheritance from `fieldset` elements in IE.
|
|
253
|
+
* 3. Remove the padding so developers are not caught out when they zero out
|
|
254
|
+
* `fieldset` elements in all browsers.
|
|
255
|
+
*/
|
|
256
|
+
|
|
257
|
+
legend {
|
|
258
|
+
box-sizing: border-box;
|
|
259
|
+
/* 1 */
|
|
260
|
+
color: inherit;
|
|
261
|
+
/* 2 */
|
|
262
|
+
display: table;
|
|
263
|
+
/* 1 */
|
|
264
|
+
max-width: 100%;
|
|
265
|
+
/* 1 */
|
|
266
|
+
padding: 0;
|
|
267
|
+
/* 3 */
|
|
268
|
+
white-space: normal;
|
|
269
|
+
/* 1 */
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
|
|
274
|
+
*/
|
|
275
|
+
|
|
276
|
+
progress {
|
|
277
|
+
vertical-align: baseline;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* Remove the default vertical scrollbar in IE 10+.
|
|
282
|
+
*/
|
|
283
|
+
|
|
284
|
+
textarea {
|
|
285
|
+
overflow: auto;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* 1. Add the correct box sizing in IE 10.
|
|
290
|
+
* 2. Remove the padding in IE 10.
|
|
291
|
+
*/
|
|
292
|
+
|
|
293
|
+
[type="checkbox"],
|
|
294
|
+
[type="radio"] {
|
|
295
|
+
box-sizing: border-box;
|
|
296
|
+
/* 1 */
|
|
297
|
+
padding: 0;
|
|
298
|
+
/* 2 */
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Correct the cursor style of increment and decrement buttons in Chrome.
|
|
303
|
+
*/
|
|
304
|
+
|
|
305
|
+
[type="number"]::-webkit-inner-spin-button,
|
|
306
|
+
[type="number"]::-webkit-outer-spin-button {
|
|
307
|
+
height: auto;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* 1. Correct the odd appearance in Chrome and Safari.
|
|
312
|
+
* 2. Correct the outline style in Safari.
|
|
313
|
+
*/
|
|
314
|
+
|
|
315
|
+
[type="search"] {
|
|
316
|
+
-webkit-appearance: textfield;
|
|
317
|
+
/* 1 */
|
|
318
|
+
outline-offset: -2px;
|
|
319
|
+
/* 2 */
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Remove the inner padding in Chrome and Safari on macOS.
|
|
324
|
+
*/
|
|
325
|
+
|
|
326
|
+
[type="search"]::-webkit-search-decoration {
|
|
327
|
+
-webkit-appearance: none;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* 1. Correct the inability to style clickable types in iOS and Safari.
|
|
332
|
+
* 2. Change font properties to `inherit` in Safari.
|
|
333
|
+
*/
|
|
334
|
+
|
|
335
|
+
::-webkit-file-upload-button {
|
|
336
|
+
-webkit-appearance: button;
|
|
337
|
+
/* 1 */
|
|
338
|
+
font: inherit;
|
|
339
|
+
/* 2 */
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/* Interactive
|
|
343
|
+
========================================================================== */
|
|
344
|
+
|
|
345
|
+
/*
|
|
346
|
+
* Add the correct display in Edge, IE 10+, and Firefox.
|
|
347
|
+
*/
|
|
348
|
+
|
|
349
|
+
details {
|
|
350
|
+
display: block;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/*
|
|
354
|
+
* Add the correct display in all browsers.
|
|
355
|
+
*/
|
|
356
|
+
|
|
357
|
+
summary {
|
|
358
|
+
display: list-item;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/* Misc
|
|
362
|
+
========================================================================== */
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* Add the correct display in IE 10+.
|
|
366
|
+
*/
|
|
367
|
+
|
|
368
|
+
template {
|
|
369
|
+
display: none;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* Add the correct display in IE 10.
|
|
374
|
+
*/
|
|
375
|
+
|
|
376
|
+
[hidden] {
|
|
377
|
+
display: none;
|
|
378
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nopon-web/styles",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"main": "index.js",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
7
|
+
},
|
|
8
|
+
"keywords": [],
|
|
9
|
+
"author": "",
|
|
10
|
+
"license": "ISC",
|
|
11
|
+
"description": "",
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public"
|
|
14
|
+
}
|
|
15
|
+
}
|
package/theme.scss
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use './_variables' as var;
|
|
3
|
+
|
|
4
|
+
// -----------------------------
|
|
5
|
+
// 🎨 颜色设计变量命名规范
|
|
6
|
+
// -----------------------------
|
|
7
|
+
// 设计参考: https://tailwindcss.com/docs/colors
|
|
8
|
+
// 采用设计系统分级(Design Token)风格,使用结构化命名,方便主题维护与自动生成 CSS 变量。
|
|
9
|
+
// 命名格式: $<color-name>-<scale>
|
|
10
|
+
//
|
|
11
|
+
// - color-name: 颜色语义标识或色调(如 primary、success、gray)
|
|
12
|
+
// - scale: 数值越小表示颜色越浅(如 50 接近白色,900 接近黑色)
|
|
13
|
+
//
|
|
14
|
+
// 🌟 建议使用分级: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950
|
|
15
|
+
// - 500 为主色基准值(推荐 UI 主色)
|
|
16
|
+
// - 其他等级用于 hover、disabled、背景、边框等场景
|
|
17
|
+
//
|
|
18
|
+
// 🔄 可统一生成 CSS Variables,用于 :root 或主题切换
|
|
19
|
+
// e.g. $primary-500 → --primary-500
|
|
20
|
+
|
|
21
|
+
// 主题色
|
|
22
|
+
$theme-color-50: #ede6ff;
|
|
23
|
+
$theme-color-500: #6e64c8;
|
|
24
|
+
|
|
25
|
+
// 基础色(背景/字体)
|
|
26
|
+
$color-base-50: #fff;
|
|
27
|
+
$color-base-250: #f5f6f7;
|
|
28
|
+
$color-base-500: #eee;
|
|
29
|
+
$color-base-inverse-50: #777777;
|
|
30
|
+
$color-base-inverse-250: #333333;
|
|
31
|
+
$color-base-inverse-500: #000000;
|
|
32
|
+
|
|
33
|
+
// 警告色
|
|
34
|
+
$color-danger-500: #ff7b7b;
|
|
35
|
+
|
|
36
|
+
// -----------------------------
|
|
37
|
+
// 🔤 字体设计变量命名规范
|
|
38
|
+
// -----------------------------
|
|
39
|
+
// 设计参考: https://tailwindcss.com/docs/font-size
|
|
40
|
+
// 参考标准: https://developer.mozilla.org/en-US/docs/Web/CSS/font-size#values
|
|
41
|
+
// xx-small、x-small、small、medium、large、x-large、xx-large、xxx-large(基于用户默认字体大小(medium)的绝对大小关键字)
|
|
42
|
+
|
|
43
|
+
$size-root: 16; // 🔤 尺寸基准值,控制设计稿与真实页面的缩放比例
|
|
44
|
+
|
|
45
|
+
$text-small-map: (
|
|
46
|
+
// 14px
|
|
47
|
+
0: 0.875,
|
|
48
|
+
// 12px
|
|
49
|
+
1: 0.75,
|
|
50
|
+
// 10px
|
|
51
|
+
2: 0.625,
|
|
52
|
+
// 8px
|
|
53
|
+
3: 0.5,
|
|
54
|
+
// 6px
|
|
55
|
+
4: 0.375,
|
|
56
|
+
// 4px
|
|
57
|
+
5: 0.25,
|
|
58
|
+
// 2px
|
|
59
|
+
6: 0.125
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
$text-large-map: (
|
|
63
|
+
// 18px
|
|
64
|
+
0: 1.125,
|
|
65
|
+
// 20px
|
|
66
|
+
1: 1.25,
|
|
67
|
+
// 24px
|
|
68
|
+
2: 1.5,
|
|
69
|
+
// 30px
|
|
70
|
+
3: 1.875,
|
|
71
|
+
4: 2.25,
|
|
72
|
+
5: 3,
|
|
73
|
+
6: 3.75,
|
|
74
|
+
7: 4.5,
|
|
75
|
+
8: 6,
|
|
76
|
+
9: 8
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
// 获取字体大小比例
|
|
80
|
+
@function text-get-ratio($scale, $step) {
|
|
81
|
+
$ratio: 1; // 默认值
|
|
82
|
+
|
|
83
|
+
@if $scale == small and map.has-key($text-small-map, $step) {
|
|
84
|
+
$ratio: map.get($text-small-map, $step);
|
|
85
|
+
} @else if $scale == large and map.has-key($text-large-map, $step) {
|
|
86
|
+
$ratio: map.get($text-large-map, $step);
|
|
87
|
+
} @else {
|
|
88
|
+
@warn "text-get-ratio(): 无效的 scale 或 step,返回基础值";
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@return $ratio;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// 主题变量
|
|
95
|
+
@mixin vars {
|
|
96
|
+
// 🌈 主题色
|
|
97
|
+
--theme-color-50: #{$theme-color-50};
|
|
98
|
+
--theme-color-500: #{$theme-color-500};
|
|
99
|
+
|
|
100
|
+
// 🎨 基础颜色
|
|
101
|
+
--color-base-50: #{$color-base-50};
|
|
102
|
+
--color-base-250: #{$color-base-250};
|
|
103
|
+
--color-base-500: #{$color-base-500};
|
|
104
|
+
--color-base-inverse-50: #{$color-base-inverse-50};
|
|
105
|
+
--color-base-inverse-250: #{$color-base-inverse-250};
|
|
106
|
+
--color-base-inverse-500: #{$color-base-inverse-500};
|
|
107
|
+
--color-danger-500: #{$color-danger-500};
|
|
108
|
+
|
|
109
|
+
// 🔤 尺寸基准值,控制设计稿与真实页面的缩放比例
|
|
110
|
+
--size-root: #{$size-root};
|
|
111
|
+
|
|
112
|
+
// 🔤 最小单位:等效于 1px:
|
|
113
|
+
// - 当使用 rem 方案:1px = calc(1 / var(--size-root) * 1rem)
|
|
114
|
+
// - 当使用 vw 方案:1px = calc(1 / var(--size-root) * 100vw)
|
|
115
|
+
--size-unit: calc(1 / var(--size-root) * 1rem);
|
|
116
|
+
|
|
117
|
+
// 🔠 字体尺寸(根据 --size-root 等比缩放)
|
|
118
|
+
--text-6xs: calc(var(--text-base) * #{text-get-ratio(small, 6)});
|
|
119
|
+
--text-5xs: calc(var(--text-base) * #{text-get-ratio(small, 5)});
|
|
120
|
+
--text-4xs: calc(var(--text-base) * #{text-get-ratio(small, 4)});
|
|
121
|
+
--text-3xs: calc(var(--text-base) * #{text-get-ratio(small, 3)});
|
|
122
|
+
--text-2xs: calc(var(--text-base) * #{text-get-ratio(small, 2)});
|
|
123
|
+
--text-xs: calc(var(--text-base) * #{text-get-ratio(small, 1)});
|
|
124
|
+
--text-sm: calc(var(--text-base) * #{text-get-ratio(small, 0)});
|
|
125
|
+
--text-base: calc(16 * var(--size-unit));
|
|
126
|
+
--text-lg: calc(var(--text-base) * #{text-get-ratio(large, 0)});
|
|
127
|
+
--text-xl: calc(var(--text-base) * #{text-get-ratio(large, 1)});
|
|
128
|
+
--text-2xl: calc(var(--text-base) * #{text-get-ratio(large, 2)});
|
|
129
|
+
--text-3xl: calc(var(--text-base) * #{text-get-ratio(large, 3)});
|
|
130
|
+
--text-4xl: calc(var(--text-base) * #{text-get-ratio(large, 4)});
|
|
131
|
+
--text-5xl: calc(var(--text-base) * #{text-get-ratio(large, 5)});
|
|
132
|
+
--text-6xl: calc(var(--text-base) * #{text-get-ratio(large, 6)});
|
|
133
|
+
--text-7xl: calc(var(--text-base) * #{text-get-ratio(large, 7)});
|
|
134
|
+
--text-8xl: calc(var(--text-base) * #{text-get-ratio(large, 8)});
|
|
135
|
+
--text-9xl: calc(var(--text-base) * #{text-get-ratio(large, 9)});
|
|
136
|
+
|
|
137
|
+
// 🧱 层级控制
|
|
138
|
+
--z-index-base: #{var.$z-index-base};
|
|
139
|
+
|
|
140
|
+
// 🎯 语义色扩展(从基础色继承)
|
|
141
|
+
--color-text-500: var(--color-base-inverse-500);
|
|
142
|
+
--color-text-inverse-500: var(--color-base-50);
|
|
143
|
+
--color-icon-500: var(--color-base-inverse-500);
|
|
144
|
+
--color-border-500: var(--color-base-500);
|
|
145
|
+
--color-bg-500: var(--color-base-250);
|
|
146
|
+
|
|
147
|
+
// 🌙 暗色模式变量切换(通过类名控制)
|
|
148
|
+
&.dark {
|
|
149
|
+
--color-base-inverse-50: #{$color-base-50};
|
|
150
|
+
--color-base-inverse-250: #{$color-base-250};
|
|
151
|
+
--color-base-inverse-500: #{$color-base-500};
|
|
152
|
+
|
|
153
|
+
--color-base-50: #{$color-base-inverse-500};
|
|
154
|
+
--color-base-250: #{$color-base-inverse-250};
|
|
155
|
+
--color-base-500: #{$color-base-inverse-50};
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
font-size: calc(var(--size-root) * 1px);
|
|
159
|
+
}
|