Skip to content

Commit e52b710

Browse files
committed
新增 effects sizing
1 parent 2dc1eca commit e52b710

File tree

9 files changed

+728
-385
lines changed

9 files changed

+728
-385
lines changed

dist/acss-helper.css

Lines changed: 293 additions & 180 deletions
Large diffs are not rendered by default.

docs/css/acss-helper.css

Lines changed: 293 additions & 180 deletions
Large diffs are not rendered by default.

docs/index.html

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,22 @@ <h2 id="border" class="border-b-1 border-b-solid border-gray-200 py-5 font-bold"
145145
</div>
146146
</div>
147147
</div>
148+
<!-- border-radius -->
149+
<h2 id="border-radius" class="border-b-1 border-b-solid border-gray-200 py-5 font-bold">border-radius</h2>
150+
<div class="row my-5 justify-between">
151+
<div class="col-2 text-c" v-for="item in borderRadius">
152+
<div class="w-16 h-16 border mx-auto" :class="`rounded-${item}`">{{item}}</div>
153+
<p class="my-5">.rounded-{{item}}</p>
154+
</div>
155+
</div>
156+
<!-- box-shadow -->
157+
<h2 id="border-radius" class="border-b-1 border-b-solid border-gray-200 py-5 font-bold">box-shadow</h2>
158+
<div class="row my-5">
159+
<div class="col-3 text-c" v-for="item in boxShadow">
160+
<div class="w-16 h-16 mx-auto" :class="`shadow-${item}`"></div>
161+
<p class="my-5">.shadow-{{item}}</p>
162+
</div>
163+
</div>
148164
</div>
149165
<div class="sidebar col-3">
150166
<div>
@@ -172,8 +188,8 @@ <h3 class="font-bold pl-2 text-2xl mt-5">Category</h3>
172188
'font-size',
173189
'font-weight',
174190
'border',
175-
'radius',
176-
'shadows',
191+
'border-radius',
192+
'box-shadow',
177193
'alignment',
178194
'gutter',
179195
'display',
@@ -301,7 +317,9 @@ <h3 class="font-bold pl-2 text-2xl mt-5">Category</h3>
301317
borderStyle: ['solid', 'dashed', 'dotted', 'double', 'none'],
302318
borderDirection: ['t', 'r', 'b', 'l'],
303319
borderColor: ['pink-500', 'purple-500', 'indigo-500', 'blue-500', 'yellow-500', 'orange-500']
304-
}
320+
},
321+
borderRadius: ["none", "sm", "default", "lg", "full"],
322+
boxShadow: ['default', 'md', 'lg', 'xl', '2xl', 'inner', 'outline', 'none']
305323
}
306324
})
307325
</script>

src/_effects.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// --------------------------------------------------
2+
// box-shadow
3+
// --------------------------------------------------
4+
5+
@each $key, $val in $shadow {
6+
.shadow-#{$key} {
7+
box-shadow: unquote($val);
8+
}
9+
}

src/_sizing.scss

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
// width
2+
@each $key, $val in $width {
3+
.w-#{$key} {
4+
width: $val
5+
}
6+
}
7+
8+
// height
9+
@each $key, $val in $height {
10+
.h-#{$key} {
11+
height: $val
12+
}
13+
}
14+
15+
// m-width
16+
.min-w-0{
17+
min-width: 0;
18+
}
19+
.min-w-full{
20+
min-width: 100%;
21+
}
22+
23+
// min-width
24+
.min-w-0{
25+
min-width: 0;
26+
}
27+
.min-w-full{
28+
min-width: 100%;
29+
}
30+
31+
// max-width
32+
@each $key, $val in $max-height {
33+
.max-w-#{$key} {
34+
max-width: $val
35+
}
36+
}
37+
38+
39+
40+
// min-height
41+
.min-h-0{
42+
min-height: 0;
43+
}
44+
.min-h-full{
45+
min-height: 100%;
46+
}
47+
.min-h-screen{
48+
min-height: 100vh;
49+
}
50+
51+
// max-height
52+
.max-h-full{
53+
max-height: 100%;
54+
}
55+
.max-h-screen {
56+
max-height: 100vh;
57+
}

src/_spacing.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
// --------------------------------------------------
22
// margin & padding
33
// --------------------------------------------------
4+
.mx-auto{
5+
margin-left: auto;
6+
margin-right: auto;
7+
}
48

59
// .m-10 -> margin: 10px;
610
// .m--10-> margin: -10px;
7-
$true: true;
811
@each $typeKey, $typeVal in $spacing-types {
912
@each $sizeKey, $sizeVal in $spacing-sizes {
1013
@if $typeKey == m{

src/_typography.scss

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,6 @@
3232
}
3333

3434

35-
// width
36-
@each $key, $val in $width {
37-
.w-#{$key} {
38-
width: $val
39-
}
40-
}
41-
42-
// height
43-
@each $key, $val in $height {
44-
.h-#{$key} {
45-
height: $val
46-
}
47-
}
48-
4935
// text-align
5036
@each $key, $val in $align-direction {
5137
.text-#{$key} {

src/_variables.scss

Lines changed: 49 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,43 @@ $line-height: (
239239
loose: '2',
240240
);
241241

242+
243+
$align-direction: (
244+
l: left,
245+
r: right,
246+
c: center,
247+
j: justify
248+
);
249+
250+
// --------------------------------------------------
251+
// Variables sizing
252+
// --------------------------------------------------
242253
$width: (
254+
0:0,
255+
1: 0.25rem,
256+
2: 0.5rem,
257+
3: 0.75rem,
258+
4: 1rem,
259+
5:1.25,
260+
6: 1.5rem,
261+
8: 2rem,
262+
10:2.5rem,
263+
12: 3rem,
264+
16: 4rem,
265+
20: 5rem,
266+
24: 6rem,
267+
32: 8rem,
268+
40: 10rem,
269+
48: 12rem,
270+
56: 14rem,
271+
64: 16rem,
272+
h: auto,
273+
px: 1px,
274+
full: 100%,
275+
screen: 100vw
276+
);
277+
278+
$height: (
243279
0:0,
244280
1: 0.25rem,
245281
2: 0.5rem,
@@ -264,14 +300,21 @@ $width: (
264300
screen: 100vh
265301
);
266302

267-
$align-direction: (
268-
l: left,
269-
r: right,
270-
c: center,
271-
j: justify
303+
$max-height : (
304+
xs :20rem,
305+
sm :24rem,
306+
md :28rem,
307+
lg :32rem,
308+
xl :36rem,
309+
2xl: 42rem,
310+
3xl: 48rem,
311+
4xl: 56rem,
312+
5xl: 64rem,
313+
6xl: 72rem,
314+
ful: 100%
272315
);
273316

274-
$height: $width !default;
317+
275318

276319
// --------------------------------------------------
277320
// Variables background
@@ -295,7 +338,6 @@ $border-radius: (
295338
sm: '0.125rem',
296339
default: '0.25rem',
297340
lg: '0.5rem',
298-
half: '50%',
299341
full: '100%'
300342
);
301343

src/helper.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
@import './border';
77
@import './border-radius';
88
@import './spacing';
9+
@import './sizing';
910
@import './shadow';
1011
@import './typography';
1112
@import './background';
13+
@import './effects';
1214
@import './grid';
1315
@import './overflow'

0 commit comments

Comments
 (0)