@neatui/css 3.0.0-beta.1 → 3.0.0-beta.3

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/core/color.scss CHANGED
@@ -1,7 +1,8 @@
1
1
  @use 'sass:list';
2
2
 
3
3
  @mixin color() {
4
- html {
4
+ html,
5
+ [theme] {
5
6
  color: var(--co-read);
6
7
  fill: var(--co-read);
7
8
  background-color: var(--co-back);
@@ -0,0 +1,128 @@
1
+ @use 'sass:list';
2
+ @use 'sass:math';
3
+
4
+ @mixin cols($cols: 24, $base: 160, $space: 1) {
5
+ $level: (
6
+ mob-s: 320px,
7
+ mob-m: 480px,
8
+ mob-l: 640px,
9
+ pad-s: 800px,
10
+ pad-m: 960px,
11
+ pad-l: 1120px,
12
+ dpc-s: 1280px,
13
+ dpc-m: 1440px,
14
+ dpc-l: 1600px
15
+ );
16
+
17
+ [ui-row] {
18
+ & {
19
+ display: flex;
20
+ flex-direction: row;
21
+ flex-wrap: wrap;
22
+ & > * {
23
+ position: relative;
24
+ }
25
+ }
26
+
27
+ // 间距
28
+ &[ui-row~='space'] {
29
+ margin: -1rem;
30
+ & > * {
31
+ padding: 1rem;
32
+ }
33
+ }
34
+
35
+ @include mob {
36
+ // 间距
37
+ &[ui-row~='space'] {
38
+ margin: -0.5rem;
39
+ & > * {
40
+ padding: 0.5rem;
41
+ }
42
+ }
43
+ }
44
+
45
+ // 撑满
46
+ &[ui-row~=':full'] {
47
+ & > * > * {
48
+ height: 100%;
49
+ }
50
+ }
51
+
52
+ // 用于容器需要居中对齐
53
+ &[ui-row~='inline'] {
54
+ display: inline-flex;
55
+ }
56
+ // 反向
57
+ &[ui-row~='reverse'] {
58
+ flex-direction: row-reverse;
59
+ }
60
+ }
61
+
62
+ // 表格使用栅格
63
+ tr[ui-row] {
64
+ display: table-row;
65
+ }
66
+ td,
67
+ th {
68
+ &[ui-col] {
69
+ display: table-cell;
70
+ }
71
+ }
72
+
73
+ // 响应断点
74
+ $level: 'mob-s', 'mob-m', 'mob-l', 'pad-s', 'pad-m', 'pad-l', 'dpc-s', 'dpc-m', 'dpc-l';
75
+ $level2: 'mob', '', '', 'pad', '', '', 'dpc', '', '';
76
+
77
+ @each $i in $level {
78
+ $d: list.nth($level2, list.index($level, $i));
79
+ // 遍历断点
80
+ $base: $base + 160;
81
+ // 基础
82
+ @if ($i == 'mob-s') {
83
+ @for $n from 0 through $cols {
84
+ // 宽度
85
+ $w: calc(math.floor(calc(100% / $cols * $n) * 100000) / 100000);
86
+ [ui-row~='mob-#{$n}'] > *,
87
+ [ui-row~='#{$i}-#{$n}'] > *,
88
+ [ui-row] [ui-col~='mob-#{$n}'],
89
+ [ui-row] [ui-col~='#{$i}-#{$n}'] {
90
+ width: #{$w};
91
+ }
92
+ }
93
+ } @else {
94
+ @media (min-width: #{$base}px) {
95
+ @for $n from 0 through $cols {
96
+ // 宽度
97
+ $w: calc((math.floor((calc(100% / $cols) * $n) * 100000) / 100000));
98
+ @if ($d != '') {
99
+ // 三端
100
+ [ui-row~='#{$d}-#{$n}'] > *,
101
+ [ui-row] [ui-col~='#{$d}-#{$n}'],
102
+ // 细分三端
103
+ [ui-row~='#{$i}-#{$n}'] > *,
104
+ [ui-row] [ui-col~='#{$i}-#{$n}'] {
105
+ width: #{$w};
106
+ }
107
+ } @else {
108
+ [ui-row~='#{$i}-#{$n}'] > *,
109
+ [ui-row] [ui-col~='#{$i}-#{$n}'] {
110
+ width: #{$w};
111
+ }
112
+ }
113
+ }
114
+ }
115
+ }
116
+ }
117
+
118
+ // 自动
119
+ [ui-row~='mob-auto'],
120
+ [ui-row~='pad-auto'],
121
+ [ui-row~='dpc-auto'] {
122
+ justify-content: space-between;
123
+ & > * {
124
+ flex-grow: 1;
125
+ }
126
+ }
127
+ }
128
+ @include cols();
package/core/flex.scss CHANGED
@@ -322,6 +322,10 @@
322
322
 
323
323
  @include flex();
324
324
 
325
+ @include med('<dpc') {
326
+ @include flex('pad\\:');
327
+ }
328
+
325
329
  @include med('<pad') {
326
330
  @include flex('mob\\:');
327
331
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neatui/css",
3
- "version": "3.0.0-beta.1",
3
+ "version": "3.0.0-beta.3",
4
4
  "description": "neatui",
5
5
  "main": "./neatui.scss",
6
6
  "license": "MIT",