@nanarino/stylus 1.0.0

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.
@@ -0,0 +1,32 @@
1
+ tag()
2
+ white-space nowrap
3
+ box-sizing border-box
4
+ padding var(--font-offset-parent)
5
+ border-radius var(--border-radius-md)
6
+ // vertical-align middle
7
+
8
+ .{prefix}-code:where(code)
9
+
10
+ // --color-code var(--primary-9)
11
+ // --background-color-code var(--primary-1)
12
+
13
+ color rgb(var(--color-code, var(--primary-9)))
14
+ background-color rgb(var(--background-color-code, var(--primary-1)))
15
+ tag()
16
+
17
+
18
+ .{prefix}-tag
19
+ .{prefix}-kbd:where(kbd)
20
+
21
+ // --color-tag var(--primary-6)
22
+ // --background-color-tag var(--primary-1)
23
+
24
+ display inline-block
25
+ border 1px none rgb(var(--color-tag, var(--primary-6)))
26
+ color rgb(var(--color-tag, var(--primary-6)))
27
+ background-color rgb(var(--background-color-tag, var(--primary-1)))
28
+ tag()
29
+
30
+ /.{prefix}-kbd:where(kbd)
31
+ border-bottom-style solid
32
+ padding var(--font-offset-parent) calc(var(--font-offset-parent) * 2)
@@ -0,0 +1,73 @@
1
+ set_title_styl(size=6)
2
+ line-height var(_get_var_by(
3
+ line-height,
4
+ 'h%s' % size
5
+ ))
6
+ // line-height @height
7
+ font-size var(_get_var_by(
8
+ font-size,
9
+ 'h%s' % size
10
+ ))
11
+
12
+ & ^[0]-subtitle
13
+ line-height var(_get_var_by(
14
+ line-height,
15
+ 7 - size
16
+ ))
17
+ font-size var(_get_var_by(
18
+ font-size,
19
+ 7 - size
20
+ ))
21
+
22
+
23
+ .{prefix}-title
24
+ // &>*
25
+ // display inline-flex
26
+ // vertical-align middle
27
+ // align-items center
28
+
29
+ padding 0
30
+ // mixin_line_clamp(1)
31
+ font-weight normal
32
+ margin 1em 0
33
+ set_title_styl()
34
+ &-subtitle
35
+ margin-left var(--font-offset-parent)
36
+ vertical-align bottom
37
+ color rgb(var(_get_var_by('gray', 6)))
38
+
39
+
40
+ for i in range(1 6)
41
+ /h{i}&
42
+ set_title_styl(i)
43
+ set_has_prefix()
44
+ &:where([data-size=\"{i}\"])
45
+ set_title_styl(i)
46
+
47
+
48
+ set_prefix()
49
+ // --color-title-prefix var(--gray-3)
50
+
51
+ position relative
52
+ padding-left calc(var(--font-offset-parent) * 3)
53
+
54
+ &::before
55
+ position absolute
56
+ content ""
57
+ width 4px
58
+ border-radius 2px
59
+ left 0
60
+ top var(--font-offset-parent)
61
+ bottom var(--font-offset-parent)
62
+ background-color rgb(var(--color-title-prefix, var(--color-blockquote-prefix, var(--gray-3))))
63
+ ^[-1]:where([data-primary])
64
+ --color-title-prefix var(--primary-5)
65
+
66
+
67
+ .{prefix}-blockquote
68
+ margin 0
69
+ color rgb(var(--color-blockquote, var(--gray-7)))
70
+
71
+ .{prefix}-blockquote
72
+ .{prefix}-title:where([data-has-prefix])
73
+ set_prefix()
@@ -0,0 +1,259 @@
1
+ :root
2
+ background rgb(var(--white))
3
+ color rgb(var(--black))
4
+ :root, :root[data-theme=light]
5
+ --white 255 255 255
6
+ --black 0 0 0
7
+ color-scheme light
8
+ :root[data-theme=dark]
9
+ --white 0 0 0
10
+ --black 255 255 255
11
+ color-scheme dark
12
+ /**
13
+ * @desc 配色,完全使用arco.design的默认配色
14
+ *
15
+ * @copy https://arco.design/palette/list
16
+ *
17
+ */
18
+ :root, :root[data-theme=light]
19
+ --red-1 255 236 232
20
+ --red-2 253 205 197
21
+ --red-3 251 172 163
22
+ --red-4 249 137 129
23
+ --red-5 247 101 96
24
+ --red-6 245 63 63
25
+ --red-7 203 39 45
26
+ --red-8 161 21 30
27
+ --red-9 119 8 19
28
+ --red-10 77 0 10
29
+ --orange-1 255 247 232
30
+ --orange-2 255 228 186
31
+ --orange-3 255 207 139
32
+ --orange-4 255 182 93
33
+ --orange-5 255 154 46
34
+ --orange-6 255 125 0
35
+ --orange-7 210 95 0
36
+ --orange-8 166 69 0
37
+ --orange-9 121 46 0
38
+ --orange-10 77 27 0
39
+ --gold-1 255 252 232
40
+ --gold-2 253 244 191
41
+ --gold-3 252 233 150
42
+ --gold-4 250 220 109
43
+ --gold-5 249 204 69
44
+ --gold-6 247 186 30
45
+ --gold-7 204 146 19
46
+ --gold-8 162 109 10
47
+ --gold-9 119 75 4
48
+ --gold-10 77 45 0
49
+ --yellow-1 254 255 232
50
+ --yellow-2 254 254 190
51
+ --yellow-3 253 250 148
52
+ --yellow-4 252 242 107
53
+ --yellow-5 251 232 66
54
+ --yellow-6 250 220 25
55
+ --yellow-7 207 175 15
56
+ --yellow-8 163 132 8
57
+ --yellow-9 120 93 3
58
+ --yellow-10 77 56 0
59
+ --lime-1 252 255 232
60
+ --lime-2 237 248 187
61
+ --lime-3 220 241 144
62
+ --lime-4 201 233 104
63
+ --lime-5 181 226 65
64
+ --lime-6 159 219 29
65
+ --lime-7 126 183 18
66
+ --lime-8 95 148 10
67
+ --lime-9 67 112 4
68
+ --lime-10 42 77 0
69
+ --green-1 232 255 234
70
+ --green-2 175 240 181
71
+ --green-3 123 225 136
72
+ --green-4 76 210 99
73
+ --green-5 35 195 67
74
+ --green-6 0 180 42
75
+ --green-7 0 154 41
76
+ --green-8 0 128 38
77
+ --green-9 0 102 34
78
+ --green-10 0 77 28
79
+ --cyan-1 232 255 251
80
+ --cyan-2 183 244 236
81
+ --cyan-3 137 233 224
82
+ --cyan-4 94 223 214
83
+ --cyan-5 55 212 207
84
+ --cyan-6 20 201 201
85
+ --cyan-7 13 165 170
86
+ --cyan-8 7 130 139
87
+ --cyan-9 3 97 108
88
+ --cyan-10 0 66 77
89
+ --blue-1 232 247 255
90
+ --blue-2 195 231 254
91
+ --blue-3 159 212 253
92
+ --blue-4 123 192 252
93
+ --blue-5 87 169 251
94
+ --blue-6 52 145 250
95
+ --blue-7 32 108 207
96
+ --blue-8 17 75 163
97
+ --blue-9 6 48 120
98
+ --blue-10 0 26 77
99
+ --purple-1 245 232 255
100
+ --purple-2 221 190 246
101
+ --purple-3 195 150 237
102
+ --purple-4 168 113 227
103
+ --purple-5 141 78 218
104
+ --purple-6 114 46 209
105
+ --purple-7 85 29 176
106
+ --purple-8 60 16 143
107
+ --purple-9 39 6 110
108
+ --purple-10 22 0 77
109
+ --pinkpurple-1 255 232 251
110
+ --pinkpurple-2 247 186 239
111
+ --pinkpurple-3 240 142 230
112
+ --pinkpurple-4 232 101 223
113
+ --pinkpurple-5 225 62 219
114
+ --pinkpurple-6 217 26 217
115
+ --pinkpurple-7 176 16 182
116
+ --pinkpurple-8 138 9 147
117
+ --pinkpurple-9 101 3 112
118
+ --pinkpurple-10 66 0 77
119
+ --magenta-1 255 232 241
120
+ --magenta-2 253 194 219
121
+ --magenta-3 251 157 199
122
+ --magenta-4 249 121 183
123
+ --magenta-5 247 84 168
124
+ --magenta-6 245 49 157
125
+ --magenta-7 203 30 131
126
+ --magenta-8 161 16 105
127
+ --magenta-9 119 6 79
128
+ --magenta-10 77 0 52
129
+ --gray-1 248 248 248
130
+ --gray-2 240 240 240
131
+ --gray-3 224 224 224
132
+ --gray-4 196 196 196
133
+ --gray-5 169 169 169
134
+ --gray-6 134 134 134
135
+ --gray-7 107 107 107
136
+ --gray-8 78 78 78
137
+ --gray-9 39 39 39
138
+ --gray-10 29 29 29
139
+ :root[data-theme=dark]
140
+ --red-1 77 0 10
141
+ --red-2 119 6 17
142
+ --red-3 161 22 31
143
+ --red-4 203 46 52
144
+ --red-5 245 78 78
145
+ --red-6 247 105 101
146
+ --red-7 249 141 134
147
+ --red-8 251 176 167
148
+ --red-9 253 209 202
149
+ --red-10 255 240 236
150
+ --orange-1 77 27 0
151
+ --orange-2 121 48 4
152
+ --orange-3 166 75 10
153
+ --orange-4 210 105 19
154
+ --orange-5 255 141 31
155
+ --orange-6 255 150 38
156
+ --orange-7 255 179 87
157
+ --orange-8 255 205 135
158
+ --orange-9 255 227 184
159
+ --orange-10 255 247 232
160
+ --gold-1 77 45 0
161
+ --gold-2 119 75 4
162
+ --gold-3 162 111 15
163
+ --gold-4 204 150 31
164
+ --gold-5 247 192 52
165
+ --gold-6 249 204 68
166
+ --gold-7 250 220 108
167
+ --gold-8 252 233 149
168
+ --gold-9 253 244 190
169
+ --gold-10 255 252 232
170
+ --yellow-1 77 56 0
171
+ --yellow-2 120 94 7
172
+ --yellow-3 163 134 20
173
+ --yellow-4 207 179 37
174
+ --yellow-5 250 225 60
175
+ --yellow-6 251 233 75
176
+ --yellow-7 252 243 116
177
+ --yellow-8 253 250 157
178
+ --yellow-9 254 254 198
179
+ --yellow-10 254 255 240
180
+ --lime-1 42 77 0
181
+ --lime-2 68 112 6
182
+ --lime-3 98 148 18
183
+ --lime-4 132 183 35
184
+ --lime-5 168 219 57
185
+ --lime-6 184 226 75
186
+ --lime-7 203 233 112
187
+ --lime-8 222 241 152
188
+ --lime-9 238 248 194
189
+ --lime-10 253 255 238
190
+ --green-1 0 77 28
191
+ --green-2 4 102 37
192
+ --green-3 10 128 45
193
+ --green-4 18 154 55
194
+ --green-5 29 180 64
195
+ --green-6 39 195 70
196
+ --green-7 80 210 102
197
+ --green-8 126 225 139
198
+ --green-9 178 240 183
199
+ --green-10 235 255 236
200
+ --cyan-1 0 66 77
201
+ --cyan-2 6 97 108
202
+ --cyan-3 17 131 139
203
+ --cyan-4 31 166 170
204
+ --cyan-5 48 201 201
205
+ --cyan-6 63 212 207
206
+ --cyan-7 102 223 215
207
+ --cyan-8 144 233 225
208
+ --cyan-9 190 244 237
209
+ --cyan-10 240 255 252
210
+ --blue-1 0 26 77
211
+ --blue-2 5 47 120
212
+ --blue-3 19 76 163
213
+ --blue-4 41 113 207
214
+ --blue-5 70 154 250
215
+ --blue-6 90 170 251
216
+ --blue-7 125 193 252
217
+ --blue-8 161 213 253
218
+ --blue-9 198 232 254
219
+ --blue-10 234 248 255
220
+ --purple-1 22 0 77
221
+ --purple-2 39 6 110
222
+ --purple-3 62 19 143
223
+ --purple-4 90 37 176
224
+ --purple-5 123 61 209
225
+ --purple-6 142 81 218
226
+ --purple-7 169 116 227
227
+ --purple-8 197 154 237
228
+ --purple-9 223 194 246
229
+ --purple-10 247 237 255
230
+ --pinkpurple-1 66 0 77
231
+ --pinkpurple-2 101 3 112
232
+ --pinkpurple-3 138 13 147
233
+ --pinkpurple-4 176 27 182
234
+ --pinkpurple-5 217 46 217
235
+ --pinkpurple-6 225 61 219
236
+ --pinkpurple-7 232 102 223
237
+ --pinkpurple-8 240 146 230
238
+ --pinkpurple-9 247 193 240
239
+ --pinkpurple-10 255 242 253
240
+ --magenta-1 77 0 52
241
+ --magenta-2 119 8 80
242
+ --magenta-3 161 23 108
243
+ --magenta-4 203 43 136
244
+ --magenta-5 245 69 166
245
+ --magenta-6 247 86 169
246
+ --magenta-7 249 122 184
247
+ --magenta-8 251 158 200
248
+ --magenta-9 253 195 219
249
+ --magenta-10 255 232 241
250
+ --gray-1 23 23 23
251
+ --gray-2 46 46 46
252
+ --gray-3 72 72 72
253
+ --gray-4 95 95 95
254
+ --gray-5 120 120 120
255
+ --gray-6 146 146 146
256
+ --gray-7 171 171 171
257
+ --gray-8 197 197 197
258
+ --gray-9 223 223 223
259
+ --gray-10 246 246 246
@@ -0,0 +1,21 @@
1
+ /**
2
+ * 希望不被继承 所以用通配符
3
+ */
4
+ *
5
+ --box-shadow-color var(--gray-4)
6
+
7
+ /**
8
+ * 边框
9
+ */
10
+ --box-shadow-divider-left inset 1px 0 0 0 rgb(var(--box-shadow-color) \/ .25)
11
+ --box-shadow-divider-top inset 0 1px 0 0 rgb(var(--box-shadow-color) \/ .25)
12
+ --box-shadow-divider-right inset -1px 0 0 0 rgb(var(--box-shadow-color) \/ .25)
13
+ --box-shadow-divider-bottom inset 0 -1px 0 0 rgb(var(--box-shadow-color) \/ .25)
14
+
15
+ /**
16
+ * 外阴影
17
+ */
18
+ --box-shadow-drop-top 0 -6px 12px 4px rgb(var(--box-shadow-color) \/ .25), 0 -3px 28px 0 rgb(var(--box-shadow-color) \/ .4), 0 -1px 2px -1px rgb(var(--box-shadow-color) \/ .56)
19
+ --box-shadow-drop-left -6px 0 12px 4px rgb(var(--box-shadow-color) \/ .25), -3px 0 6px 0 rgb(var(--box-shadow-color) \/ .4), -1px 0 2px -1px rgb(var(--box-shadow-color) \/ .56)
20
+ --box-shadow-drop-right 6px 0 12px 4px rgb(var(--box-shadow-color) \/ .25), 3px 0 6px 0 rgb(var(--box-shadow-color) \/ .4), 1px 0 2px -1px rgb(var(--box-shadow-color) \/ .56)
21
+ --box-shadow-drop-bottom 0 6px 12px 4px rgb(var(--box-shadow-color) \/ .25), 0 3px 6px 0 rgb(var(--box-shadow-color) \/ .4), 0 1px 2px -1px rgb(var(--box-shadow-color) \/ .56)
@@ -0,0 +1,52 @@
1
+ :root
2
+ /**
3
+ * 圆角
4
+ */
5
+ --border-radius-sm 4px
6
+ --border-radius-md 8px
7
+ --border-radius-lg 16px
8
+
9
+ /**
10
+ * 字号
11
+ */
12
+ --font-size-1 12px // 12
13
+ --font-size-2 @--font-size-1 + 2px // 14
14
+ --font-size-3 @--font-size-2 + 2px // 16
15
+ --font-size-4 @--font-size-3 + 4px // 20
16
+ --font-size-5 @--font-size-4 + 4px // 24
17
+ --font-size-6 @--font-size-5 + 6px // 30
18
+ --font-size-7 @--font-size-6 + 8px // 38
19
+ --font-size-8 @--font-size-7 + 8px // 46
20
+ --font-size-9 @--font-size-8 + 10px // 56
21
+ --font-size-10 @--font-size-9 + 12px // 68
22
+ --font-size-base @--font-size-1
23
+ --font-size-body @--font-size-2
24
+ --font-size-h6 @--font-size-2
25
+ --font-size-h5 @--font-size-3
26
+ --font-size-h4 @--font-size-4
27
+ --font-size-h3 @--font-size-5
28
+ --font-size-h2 @--font-size-6
29
+ --font-size-h1 @--font-size-7
30
+
31
+ /**
32
+ * 行高
33
+ */
34
+ --font-offset-parent 4px
35
+ --line-height-1 @--font-size-1 + @--font-offset-parent * 2 // 20
36
+ --line-height-2 @--font-size-2 + @--font-offset-parent * 2 // 22
37
+ --line-height-3 @--font-size-3 + @--font-offset-parent * 2 // 24
38
+ --line-height-4 @--font-size-4 + @--font-offset-parent * 2 // 28
39
+ --line-height-5 @--font-size-5 + @--font-offset-parent * 2 // 32
40
+ --line-height-6 @--font-size-6 + @--font-offset-parent * 2 // 38
41
+ --line-height-7 @--font-size-7 + @--font-offset-parent * 2 // 46
42
+ --line-height-8 @--font-size-8 + @--font-offset-parent * 2 // 54
43
+ --line-height-9 @--font-size-9 + @--font-offset-parent * 2 // 64
44
+ --line-height-10 @--font-size-10 + @--font-offset-parent * 2 // 76
45
+ --line-height-base @--line-height-1
46
+ --line-height-body @--line-height-2
47
+ --line-height-h6 @--line-height-2
48
+ --line-height-h5 @--line-height-3
49
+ --line-height-h4 @--line-height-4
50
+ --line-height-h3 @--line-height-5
51
+ --line-height-h2 @--line-height-6
52
+ --line-height-h1 @--line-height-7
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@nanarino/stylus",
3
+ "description": "style lib",
4
+ "version": "1.0.0",
5
+ "main": "./dist/style.min.css",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/nanarino/stylus.git"
9
+ },
10
+ "homepage": "https://nanarino.github.io/stylus/",
11
+ "keywords": [
12
+ "ui",
13
+ "stylus"
14
+ ],
15
+ "author": "kogawananari",
16
+ "license": "MIT",
17
+ "bugs": {
18
+ "url": "https://github.com/nanarino/stylus/issues"
19
+ },
20
+ "peerDependencies": {
21
+ "stylus": "^0.64.0"
22
+ },
23
+ "devDependencies": {
24
+ "@astrojs/mdx": "^4.3.6",
25
+ "@fontsource/jetbrains-mono": "^5.2.8",
26
+ "@holy-two/data-theme": "^0.0.7",
27
+ "@types/node": "^22.18.6",
28
+ "astro": "^5.13.10",
29
+ "astro-icon": "^1.1.5",
30
+ "copy-to-clipboard": "^3.3.3",
31
+ "css-doodle": "^0.43.1",
32
+ "csso-cli": "^4.0.2",
33
+ "dedent": "^1.7.0",
34
+ "rm-all": "^1.1.1",
35
+ "smooth-corners": "^1.1.0",
36
+ "style-to-object": "^1.0.9",
37
+ "stylus": "^0.64.0"
38
+ },
39
+ "files": [
40
+ "dist",
41
+ "lib"
42
+ ],
43
+ "scripts": {
44
+ "dev": "astro dev --host",
45
+ "start": "astro dev",
46
+ "build:docs": "astro build",
47
+ "build:demo": "rma ./dist && mkdir dist && stylus ./demo/index.styl -o ./dist/demo.css",
48
+ "build:styl": "rma ./dist && mkdir dist && stylus ./lib/index.styl -p | csso -o ./dist/style.min.css",
49
+ "build:gh-pages": "astro build --base /stylus/",
50
+ "preview": "astro preview"
51
+ }
52
+ }