@farris/cli 2.0.3 → 2.1.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/lib/commands/build.js +6 -7
- package/lib/commands/build.js.map +1 -1
- package/lib/commands/generate/api.js +188 -0
- package/lib/commands/generate/api.js.map +1 -0
- package/lib/commands/generate/common.js +101 -0
- package/lib/commands/generate/common.js.map +1 -0
- package/lib/commands/generate/component.js +164 -0
- package/lib/commands/generate/component.js.map +1 -0
- package/lib/commands/generate/view.js +195 -0
- package/lib/commands/generate/view.js.map +1 -0
- package/lib/commands/workspace/add-app.js +174 -0
- package/lib/commands/workspace/add-app.js.map +1 -0
- package/lib/commands/workspace/create.js +380 -0
- package/lib/commands/workspace/create.js.map +1 -0
- package/lib/commands/workspace/inspect.js +31 -0
- package/lib/commands/workspace/inspect.js.map +1 -0
- package/lib/commands/workspace/verify.js +39 -0
- package/lib/commands/workspace/verify.js.map +1 -0
- package/lib/common/constant.js +42 -1
- package/lib/common/constant.js.map +1 -1
- package/lib/common/get-vite-config.js +66 -9
- package/lib/common/get-vite-config.js.map +1 -1
- package/lib/common/output.js +95 -0
- package/lib/common/output.js.map +1 -0
- package/lib/common/safety.js +172 -0
- package/lib/common/safety.js.map +1 -0
- package/lib/common/template-renderer.js +115 -0
- package/lib/common/template-renderer.js.map +1 -0
- package/lib/common/transaction.js +84 -0
- package/lib/common/transaction.js.map +1 -0
- package/lib/common/verifier.js +147 -0
- package/lib/common/verifier.js.map +1 -0
- package/lib/config/vite-common.js +1 -1
- package/lib/config/vite-common.js.map +1 -1
- package/lib/index.js +124 -30
- package/lib/index.js.map +1 -1
- package/package.json +13 -9
- package/templates/workspace/app/farris.config.mjs +13 -0
- package/templates/{lib → workspace/app}/index.html +12 -12
- package/templates/workspace/app/package.json +22 -0
- package/templates/workspace/app/src/App.tsx +11 -0
- package/templates/workspace/app/src/main.ts +11 -0
- package/templates/workspace/app/src/router/index.ts +16 -0
- package/templates/workspace/app/src/styles/index.css +0 -0
- package/templates/workspace/app/src/styles/index.scss +0 -0
- package/templates/workspace/app/src/views/home/composables/use-home.ts +7 -0
- package/templates/workspace/app/src/views/home/home.component.tsx +15 -0
- package/templates/workspace/app/src/views/home/index.ts +4 -0
- package/templates/workspace/app/tsconfig.json +21 -0
- package/templates/workspace/root/README.md +28 -0
- package/templates/workspace/root/package.json +13 -0
- package/templates/workspace/root/pnpm-workspace.yaml +12 -0
- package/templates/lib/.eslintrc.cjs +0 -15
- package/templates/lib/.prettierrc.json +0 -8
- package/templates/lib/components/button/index.ts +0 -7
- package/templates/lib/components/button/src/button.component.tsx +0 -84
- package/templates/lib/components/button/src/button.props.ts +0 -55
- package/templates/lib/components/button/src/button.scss +0 -179
- package/templates/lib/components/common/index.ts +0 -6
- package/templates/lib/components/common/src/common.scss +0 -4
- package/templates/lib/components/common/src/compositions/index.ts +0 -19
- package/templates/lib/components/common/src/compositions/types.ts +0 -6
- package/templates/lib/components/common/src/compositions/use-bem/index.ts +0 -46
- package/templates/lib/components/common/src/compositions/use-click-away/index.ts +0 -40
- package/templates/lib/components/common/src/compositions/use-context/use-children-contexts.ts +0 -40
- package/templates/lib/components/common/src/compositions/use-context/use-parent-context.ts +0 -24
- package/templates/lib/components/common/src/compositions/use-event-listener/index.ts +0 -45
- package/templates/lib/components/common/src/compositions/use-expose/index.ts +0 -9
- package/templates/lib/components/common/src/compositions/use-lay-render/index.ts +0 -17
- package/templates/lib/components/common/src/compositions/use-link/index.ts +0 -14
- package/templates/lib/components/common/src/compositions/use-lock-scroll/index.ts +0 -25
- package/templates/lib/components/common/src/compositions/use-long-press/index.ts +0 -141
- package/templates/lib/components/common/src/compositions/use-momentum/index.ts +0 -82
- package/templates/lib/components/common/src/compositions/use-mount-component/index.ts +0 -48
- package/templates/lib/components/common/src/compositions/use-rect/index.ts +0 -31
- package/templates/lib/components/common/src/compositions/use-refs/index.ts +0 -21
- package/templates/lib/components/common/src/compositions/use-resize-observer/index.ts +0 -85
- package/templates/lib/components/common/src/compositions/use-resize-observer/utils.ts +0 -37
- package/templates/lib/components/common/src/compositions/use-scroll-parent/index.ts +0 -42
- package/templates/lib/components/common/src/compositions/use-touch/index.ts +0 -82
- package/templates/lib/components/common/src/compositions/use-touch-move/index.ts +0 -120
- package/templates/lib/components/common/src/entity/base-property.ts +0 -129
- package/templates/lib/components/common/src/entity/entity-schema.ts +0 -274
- package/templates/lib/components/common/src/entity/input-base-property.ts +0 -285
- package/templates/lib/components/common/src/style/animation/index.scss +0 -150
- package/templates/lib/components/common/src/style/base.scss +0 -63
- package/templates/lib/components/common/src/style/fonts/farris-mobile-icon.ttf +0 -0
- package/templates/lib/components/common/src/style/icon.scss +0 -6
- package/templates/lib/components/common/src/style/index.scss +0 -4
- package/templates/lib/components/common/src/style/mixins/bem.scss +0 -204
- package/templates/lib/components/common/src/style/mixins/border-radius.scss +0 -13
- package/templates/lib/components/common/src/style/mixins/ellipsis.scss +0 -15
- package/templates/lib/components/common/src/style/mixins/hairline.scss +0 -113
- package/templates/lib/components/common/src/style/mixins/index.scss +0 -6
- package/templates/lib/components/common/src/style/mixins/margin.scss +0 -10
- package/templates/lib/components/common/src/style/mixins/safe-area.scss +0 -9
- package/templates/lib/components/common/src/style/variables.scss +0 -113
- package/templates/lib/components/common/src/utils/index.ts +0 -15
- package/templates/lib/components/common/src/utils/src/common.ts +0 -83
- package/templates/lib/components/common/src/utils/src/date.ts +0 -134
- package/templates/lib/components/common/src/utils/src/dom/event.ts +0 -37
- package/templates/lib/components/common/src/utils/src/hook.ts +0 -18
- package/templates/lib/components/common/src/utils/src/number.ts +0 -26
- package/templates/lib/components/common/src/utils/src/query-filter.ts +0 -40
- package/templates/lib/components/common/src/utils/src/resove-asset.ts +0 -33
- package/templates/lib/components/common/src/utils/src/string.ts +0 -18
- package/templates/lib/components/common/src/utils/src/throttle.ts +0 -41
- package/templates/lib/components/common/src/utils/src/transition.ts +0 -14
- package/templates/lib/components/common/src/utils/src/type.ts +0 -105
- package/templates/lib/components/common/src/utils/src/use-appearance.ts +0 -33
- package/templates/lib/components/common/src/utils/src/with-install.ts +0 -16
- package/templates/lib/components/common/src/utils/src/with-register-designer.ts +0 -16
- package/templates/lib/components/common/src/utils/src/with-register.ts +0 -16
- package/templates/lib/components/common/types.ts +0 -131
- package/templates/lib/components/index.scss +0 -2
- package/templates/lib/components/index.ts +0 -21
- package/templates/lib/farris.config.mjs +0 -56
- package/templates/lib/package.json +0 -32
- package/templates/lib/src/App.vue +0 -80
- package/templates/lib/src/components/TheButton.vue +0 -3
- package/templates/lib/src/main.ts +0 -10
- package/templates/lib/src/router/index.ts +0 -23
- package/templates/lib/src/views/AboutView.vue +0 -15
- package/templates/lib/src/views/HomeView.vue +0 -9
- package/templates/lib/tsconfig.json +0 -20
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
@keyframes fm-fade-in {
|
|
2
|
-
from {
|
|
3
|
-
opacity: 0;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
to {
|
|
7
|
-
opacity: 1;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
@keyframes fm-fade-out {
|
|
12
|
-
from {
|
|
13
|
-
opacity: 1;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
to {
|
|
17
|
-
opacity: 0;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.fm-fade {
|
|
22
|
-
&-enter-active {
|
|
23
|
-
animation: 0.3s fm-fade-in both ease-out;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
&-leave-active {
|
|
27
|
-
animation: 0.3s fm-fade-out both ease-in;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.fm-slide-up {
|
|
32
|
-
&-enter-from,
|
|
33
|
-
&-leave-to {
|
|
34
|
-
transform: translate3d(0, 100%, 0);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.fm-slide-down {
|
|
39
|
-
&-enter-from,
|
|
40
|
-
&-leave-to {
|
|
41
|
-
transform: translate3d(0, -100%, 0);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.fm-slide-left {
|
|
46
|
-
&-enter-from,
|
|
47
|
-
&-leave-to {
|
|
48
|
-
transform: translate3d(-100%, 0, 0);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.fm-slide-right {
|
|
53
|
-
&-enter-from,
|
|
54
|
-
&-leave-to {
|
|
55
|
-
transform: translate3d(100%, 0, 0);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.fm-slide-up-enter-active,
|
|
60
|
-
.fm-slide-down-enter-active,
|
|
61
|
-
.fm-slide-left-enter-active,
|
|
62
|
-
.fm-slide-right-enter-active {
|
|
63
|
-
transition-timing-function: ease-out;
|
|
64
|
-
}
|
|
65
|
-
.fm-slide-up-leave-active,
|
|
66
|
-
.fm-slide-down-leave-active,
|
|
67
|
-
.fm-slide-left-leave-active,
|
|
68
|
-
.fm-slide-right-leave-active {
|
|
69
|
-
transition-timing-function: ease-in;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.fm-slide-in-enter-active,
|
|
73
|
-
.fm-slide-in-leave-active,
|
|
74
|
-
.fm-slide-out-enter-active,
|
|
75
|
-
.fm-slide-out-leave-active {
|
|
76
|
-
will-change: transform;
|
|
77
|
-
transition: all 0.3s;
|
|
78
|
-
height: 100%;
|
|
79
|
-
width: 100%;
|
|
80
|
-
top: 0px;
|
|
81
|
-
position: absolute;
|
|
82
|
-
backface-visibility: hidden;
|
|
83
|
-
perspective: 1000;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.fm-slide-in-leave-to,
|
|
87
|
-
.fm-slide-out-enter-from {
|
|
88
|
-
transform: translateX(-100%);
|
|
89
|
-
opacity: 0;
|
|
90
|
-
}
|
|
91
|
-
.fm-slide-in-enter-from,
|
|
92
|
-
.fm-slide-out-leave-to {
|
|
93
|
-
transform: translateX(100%);
|
|
94
|
-
opacity: 0;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
@keyframes fm-drop-down-in {
|
|
98
|
-
from {
|
|
99
|
-
height: 0;
|
|
100
|
-
opacity: 0;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
to {
|
|
104
|
-
opacity: 1;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
@keyframes fm-drop-down-out {
|
|
108
|
-
from {
|
|
109
|
-
opacity: 1;
|
|
110
|
-
}
|
|
111
|
-
to {
|
|
112
|
-
height: 0;
|
|
113
|
-
opacity: 0;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
.fm-drop-down {
|
|
117
|
-
&-enter-active {
|
|
118
|
-
animation: 0.3s fm-drop-down-in both ease-out;
|
|
119
|
-
}
|
|
120
|
-
&-leave-active {
|
|
121
|
-
animation: 0.3s fm-drop-down-out both ease-in;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
@keyframes fm-circular {
|
|
125
|
-
0% {
|
|
126
|
-
stroke-dasharray: 1, 200;
|
|
127
|
-
stroke-dashoffset: 0
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
50% {
|
|
131
|
-
stroke-dasharray: 90, 150;
|
|
132
|
-
stroke-dashoffset: -40
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
100% {
|
|
136
|
-
stroke-dasharray: 90, 150;
|
|
137
|
-
stroke-dashoffset: -120
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
@keyframes fm-rotate {
|
|
141
|
-
from {
|
|
142
|
-
-webkit-transform: rotate(0);
|
|
143
|
-
transform: rotate(0)
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
to {
|
|
147
|
-
-webkit-transform: rotate(360deg);
|
|
148
|
-
transform: rotate(360deg)
|
|
149
|
-
}
|
|
150
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/* Box sizing rules */
|
|
2
|
-
*,
|
|
3
|
-
*::before,
|
|
4
|
-
*::after {
|
|
5
|
-
box-sizing: border-box;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
/* Remove default margin */
|
|
9
|
-
body,
|
|
10
|
-
h1,
|
|
11
|
-
h2,
|
|
12
|
-
h3,
|
|
13
|
-
h4,
|
|
14
|
-
p,
|
|
15
|
-
figure,
|
|
16
|
-
blockquote,
|
|
17
|
-
dl,
|
|
18
|
-
dd {
|
|
19
|
-
margin: 0;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
|
|
23
|
-
ul[role="list"],
|
|
24
|
-
ol[role="list"] {
|
|
25
|
-
list-style: none;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/* Set core root defaults */
|
|
29
|
-
html:focus-within {
|
|
30
|
-
scroll-behavior: smooth;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/* Set core body defaults */
|
|
34
|
-
body {
|
|
35
|
-
min-height: 100vh;
|
|
36
|
-
text-rendering: optimizeSpeed;
|
|
37
|
-
line-height: 1.5;
|
|
38
|
-
font-family: -apple-system, "Noto Sans", "Helvetica Neue", Helvetica,
|
|
39
|
-
"Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB",
|
|
40
|
-
"Noto Sans CJK SC", "Source Han Sans SC", "Source Han Sans CN",
|
|
41
|
-
"Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti",
|
|
42
|
-
SimHei, "WenQuanYi Zen Hei Sharp", sans-serif;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/* A elements that don't have a class get default styles */
|
|
46
|
-
a:not([class]) {
|
|
47
|
-
text-decoration-skip-ink: auto;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/* Make images easier to work with */
|
|
51
|
-
img,
|
|
52
|
-
picture {
|
|
53
|
-
max-width: 100%;
|
|
54
|
-
display: block;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/* Inherit fonts for inputs and buttons */
|
|
58
|
-
input,
|
|
59
|
-
button,
|
|
60
|
-
textarea,
|
|
61
|
-
select {
|
|
62
|
-
font: inherit;
|
|
63
|
-
}
|
|
Binary file
|
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
基于 BEM(Block Element Modifier)命名规范的 SCSS 混合(mixins)和辅助函数,用于生成符合 BEM 规范的 CSS 类名
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
// 命名空间前缀,所有类名都会以 fm- 开头
|
|
6
|
-
$namespace: 'fm';
|
|
7
|
-
// 元素分隔符,用于连接 Block 和 Element,例如 fm-block__element
|
|
8
|
-
$element-separator: '__';
|
|
9
|
-
//修饰符分隔符,用于连接 Block/Element 和 Modifier,例如 fm-block--modifier
|
|
10
|
-
$modifier-separator :'--';
|
|
11
|
-
//状态前缀,用于标识组件的状态,例如 is-active
|
|
12
|
-
$state-prefix: 'is-';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
功能:将传入的选择器转换为字符串形式,并去掉首尾的引号。
|
|
16
|
-
用途:在后续函数中用于解析选择器内容。
|
|
17
|
-
*/
|
|
18
|
-
@function selectorToString($selector) {
|
|
19
|
-
$selector: inspect($selector);
|
|
20
|
-
$selector: str-slice($selector, 2, -2);
|
|
21
|
-
@return $selector;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/*
|
|
25
|
-
功能:检查选择器是否包含修饰符分隔符 --。
|
|
26
|
-
用途:判断是否需要特殊处理修饰符规则
|
|
27
|
-
*/
|
|
28
|
-
@function containsModifier($selector) {
|
|
29
|
-
$selector: selectorToString($selector);
|
|
30
|
-
|
|
31
|
-
@if str-index($selector, $modifier-separator) {
|
|
32
|
-
@return true;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
@else {
|
|
36
|
-
@return false;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/*
|
|
41
|
-
功能:检查选择器是否包含状态前缀 .is-。
|
|
42
|
-
用途:判断是否需要处理状态相关的规则。
|
|
43
|
-
*/
|
|
44
|
-
@function containWhenFlag($selector) {
|
|
45
|
-
$selector: selectorToString($selector);
|
|
46
|
-
|
|
47
|
-
@if str-index($selector, '.' + $state-prefix) {
|
|
48
|
-
@return true;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
@else {
|
|
52
|
-
@return false;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/*
|
|
57
|
-
功能:检查选择器是否包含伪类(如 :hover、:active 等)。
|
|
58
|
-
用途:判断是否需要处理伪类规则。
|
|
59
|
-
*/
|
|
60
|
-
@function containPseudoClass($selector) {
|
|
61
|
-
$selector: selectorToString($selector);
|
|
62
|
-
|
|
63
|
-
@if str-index($selector, ':') {
|
|
64
|
-
@return true;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
@else {
|
|
68
|
-
@return false;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/*
|
|
73
|
-
功能:综合判断选择器是否包含修饰符、状态或伪类。
|
|
74
|
-
用途:决定是否需要特殊嵌套规则。
|
|
75
|
-
*/
|
|
76
|
-
@function hitAllSpecialNestRule($selector) {
|
|
77
|
-
|
|
78
|
-
@return containsModifier($selector) or containWhenFlag($selector) or containPseudoClass($selector);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/*
|
|
82
|
-
功能:生成 Block 的基础类名。
|
|
83
|
-
用法:
|
|
84
|
-
输入: @include b(button) { color: red; }
|
|
85
|
-
输出:.fm-button { color: red; }
|
|
86
|
-
*/
|
|
87
|
-
@mixin b($block) {
|
|
88
|
-
|
|
89
|
-
$B: #{$namespace + '-' + $block} !global;
|
|
90
|
-
|
|
91
|
-
.#{$B} {
|
|
92
|
-
@content;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/*
|
|
97
|
-
功能:生成 Element 的类名。
|
|
98
|
-
用法:
|
|
99
|
-
输入:
|
|
100
|
-
@include b(button) {
|
|
101
|
-
@include e(text) {
|
|
102
|
-
font-size: 14px;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
输出:
|
|
106
|
-
.fm-button__text {
|
|
107
|
-
font-size: 14px;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
*/
|
|
111
|
-
@mixin e($element, $inheritParent: false) {
|
|
112
|
-
$E: $element !global;
|
|
113
|
-
$selector: &;
|
|
114
|
-
$currentSelector: "";
|
|
115
|
-
$insertSelector: "";
|
|
116
|
-
|
|
117
|
-
@each $unit in $element {
|
|
118
|
-
@if $inheritParent {
|
|
119
|
-
$currentSelector: #{$currentSelector + $selector + $element-separator + $unit + ","};
|
|
120
|
-
} @else {
|
|
121
|
-
$currentSelector: #{$currentSelector + "." + $B + $element-separator + $insertSelector + $unit + ","};
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
@if hitAllSpecialNestRule($selector) {
|
|
126
|
-
@at-root {
|
|
127
|
-
#{$selector} {
|
|
128
|
-
#{$currentSelector} {
|
|
129
|
-
@content;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
@else {
|
|
136
|
-
@at-root {
|
|
137
|
-
#{$currentSelector} {
|
|
138
|
-
@content;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
/*
|
|
145
|
-
功能:生成 Modifier 的类名。
|
|
146
|
-
用法:
|
|
147
|
-
输入:
|
|
148
|
-
@include b(button) {
|
|
149
|
-
@include m(disabled) {
|
|
150
|
-
opacity: 0.5;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
输出:
|
|
154
|
-
.fm-button--disabled {
|
|
155
|
-
opacity: 0.5;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
*/
|
|
159
|
-
@mixin m($modifier) {
|
|
160
|
-
$selector: &;
|
|
161
|
-
$currentSelector: "";
|
|
162
|
-
|
|
163
|
-
@each $unit in $modifier {
|
|
164
|
-
$currentSelector: #{$currentSelector + & + $modifier-separator + $unit + ","};
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
@at-root {
|
|
168
|
-
#{$currentSelector} {
|
|
169
|
-
@content;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
/*
|
|
175
|
-
功能:生成根节点上的 Modifier 类名。
|
|
176
|
-
用法:
|
|
177
|
-
输入:
|
|
178
|
-
@include b(button) {
|
|
179
|
-
@include e(text) {
|
|
180
|
-
@include root-m(disabled) {
|
|
181
|
-
pointer-events: none;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
输出:
|
|
187
|
-
.fm-button--disabled {
|
|
188
|
-
pointer-events: none;
|
|
189
|
-
}
|
|
190
|
-
*/
|
|
191
|
-
@mixin root-m($modifier) {
|
|
192
|
-
$selector: #{"." + $B};
|
|
193
|
-
$currentSelector: "";
|
|
194
|
-
|
|
195
|
-
@each $unit in $modifier {
|
|
196
|
-
$currentSelector: #{$currentSelector + & + $selector + $modifier-separator + $unit + ","};
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
@at-root {
|
|
200
|
-
#{$currentSelector} {
|
|
201
|
-
@content;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
@mixin borderRadius($size, $position: '') {
|
|
2
|
-
@if ($position == 'top') {
|
|
3
|
-
border-radius: 0 0 $size $size;
|
|
4
|
-
} @else if($position == 'bottom') {
|
|
5
|
-
border-radius: $size $size 0 0;
|
|
6
|
-
} @else if($position == 'left') {
|
|
7
|
-
border-radius: 0 $size $size 0;
|
|
8
|
-
} @else if($position == 'right') {
|
|
9
|
-
border-radius: $size 0 0 $size;
|
|
10
|
-
} @else {
|
|
11
|
-
border-radius: $size
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
@mixin multi-ellipsis($lines) {
|
|
2
|
-
display: -webkit-box;
|
|
3
|
-
overflow: hidden;
|
|
4
|
-
text-overflow: ellipsis;
|
|
5
|
-
-webkit-line-clamp: $lines;
|
|
6
|
-
|
|
7
|
-
/* autoprefixer: ignore next */
|
|
8
|
-
-webkit-box-orient: vertical;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
@mixin ellipsis {
|
|
12
|
-
overflow: hidden;
|
|
13
|
-
white-space: nowrap;
|
|
14
|
-
text-overflow: ellipsis;
|
|
15
|
-
}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
@mixin scale-hairline-common($color, $top, $right, $bottom, $left) {
|
|
2
|
-
content: '';
|
|
3
|
-
position: absolute;
|
|
4
|
-
background-color: $color;
|
|
5
|
-
display: block;
|
|
6
|
-
z-index: 1;
|
|
7
|
-
top: $top;
|
|
8
|
-
right: $right;
|
|
9
|
-
bottom: $bottom;
|
|
10
|
-
left: $left;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
@mixin hairline(
|
|
14
|
-
$direction,
|
|
15
|
-
$color: #ddd,
|
|
16
|
-
$radius: 0,
|
|
17
|
-
$type: solid,
|
|
18
|
-
) {
|
|
19
|
-
@if ($direction == 'top') {
|
|
20
|
-
border-top: 1px $type $color;
|
|
21
|
-
position: relative;
|
|
22
|
-
border-top: none;
|
|
23
|
-
&::before {
|
|
24
|
-
@include scale-hairline-common($color, 0, auto, auto, 0);
|
|
25
|
-
width: 100%;
|
|
26
|
-
height: 1px;
|
|
27
|
-
transform-origin: 50% 50%;
|
|
28
|
-
transform: scaleY(0.5);
|
|
29
|
-
}
|
|
30
|
-
} @else if ($direction == 'bottom') {
|
|
31
|
-
border-bottom: 1px $type $color;
|
|
32
|
-
position: relative;
|
|
33
|
-
border-bottom: none;
|
|
34
|
-
&::after {
|
|
35
|
-
@include scale-hairline-common($color, auto, auto, 0, 0);
|
|
36
|
-
width: 100%;
|
|
37
|
-
height: 1px;
|
|
38
|
-
transform-origin: 50% 100%;
|
|
39
|
-
transform: scaleY(0.5);
|
|
40
|
-
}
|
|
41
|
-
} @else if ($direction == 'left') {
|
|
42
|
-
border-left: 1px $type $color;
|
|
43
|
-
position: relative;
|
|
44
|
-
border-left: none;
|
|
45
|
-
&::before {
|
|
46
|
-
@include scale-hairline-common($color, 0, auto, auto, 0);
|
|
47
|
-
width: 1px;
|
|
48
|
-
height: 100%;
|
|
49
|
-
transform-origin: 100% 50%;
|
|
50
|
-
transform: scaleX(0.5);
|
|
51
|
-
}
|
|
52
|
-
} @else if ($direction == 'right') {
|
|
53
|
-
border-right: 1px $type $color;
|
|
54
|
-
position: relative;
|
|
55
|
-
border-right: none;
|
|
56
|
-
&::after {
|
|
57
|
-
@include scale-hairline-common($color, 0, 0, auto, auto);
|
|
58
|
-
width: 1px;
|
|
59
|
-
height: 100%;
|
|
60
|
-
background: $color;
|
|
61
|
-
transform-origin: 100% 50%;
|
|
62
|
-
transform: scaleX(0.5);
|
|
63
|
-
}
|
|
64
|
-
} @else if ($direction == 'all') {
|
|
65
|
-
border: 1px $type $color;
|
|
66
|
-
border-radius: $radius;
|
|
67
|
-
position: relative;
|
|
68
|
-
border: none;
|
|
69
|
-
&::before {
|
|
70
|
-
content: '';
|
|
71
|
-
position: absolute;
|
|
72
|
-
left: 0;
|
|
73
|
-
top: 0;
|
|
74
|
-
width: 200%;
|
|
75
|
-
height: 200%;
|
|
76
|
-
border: 1px $type $color;
|
|
77
|
-
border-radius: $radius * 2;
|
|
78
|
-
transform-origin: 0 0;
|
|
79
|
-
transform: scale(0.5);
|
|
80
|
-
box-sizing: border-box;
|
|
81
|
-
pointer-events: none;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
@mixin hairline-remove($position) {
|
|
87
|
-
@if $position == 'left' {
|
|
88
|
-
border-left: 0;
|
|
89
|
-
&:before {
|
|
90
|
-
display: none !important;
|
|
91
|
-
}
|
|
92
|
-
} @else if $position == 'right' {
|
|
93
|
-
border-right: 0;
|
|
94
|
-
&:after {
|
|
95
|
-
display: none !important;
|
|
96
|
-
}
|
|
97
|
-
} @else if $position == 'top' {
|
|
98
|
-
border-top: 0;
|
|
99
|
-
&:before {
|
|
100
|
-
display: none !important;
|
|
101
|
-
}
|
|
102
|
-
} @else if $position == 'bottom' {
|
|
103
|
-
border-bottom: 0;
|
|
104
|
-
&:after {
|
|
105
|
-
display: none !important;
|
|
106
|
-
}
|
|
107
|
-
} @else if $position == 'all' {
|
|
108
|
-
border: 0;
|
|
109
|
-
&:before {
|
|
110
|
-
display: none !important;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
@mixin safeArea($styleName) {
|
|
2
|
-
@if($styleName){
|
|
3
|
-
#{$styleName}: 0;
|
|
4
|
-
@supports ((bottom: constant(safe-area-inset-bottom)) or (bottom: env(safe-area-inset-bottom))) and (-webkit-overflow-scrolling: touch) {
|
|
5
|
-
#{$styleName}: constant(safe-area-inset-bottom);
|
|
6
|
-
#{$styleName}: env(safe-area-inset-bottom);
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
}
|