Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linweijiong
jinfa-platform
Commits
3fcaf2ac
Commit
3fcaf2ac
authored
Jun 12, 2020
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:less样式目录优化
parent
2eccf2e4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
71 additions
and
4 deletions
+71
-4
README.md
README.md
+6
-0
global.less
src/global/styles/global.less
+16
-4
font.less
src/global/styles/mixins/font.less
+0
-0
layout.less
src/global/styles/mixins/layout.less
+49
-0
No files found.
README.md
View file @
3fcaf2ac
...
...
@@ -18,3 +18,8 @@
-
chalk 控制台样式控制工具
-
fs-extra 扩展fs模块
-
ora 控制台加载中样式
## 开发注意事项
1.
样式
-
全局样式需写在src/global/global.less下, 涉及到color, size之类的属性尽量变量化 并且储存在/styles/theme.less中
\ No newline at end of file
src/global/styles/global.less
View file @
3fcaf2ac
/********************************** 布局 ******************************************/
@import './mixins/layout.less';
@makeCenters: text, block, flex, flexAlign, flexJustify, absolute, fixed, margin;
@makeCentersLen: length(@makeCenters);
.loopCenter(@list, @i: 1, @val: extract(@list, @i)) when (@i < @makeCentersLen + 1) {
.center-@{val} {
.make-center(@val);
}
.loopCenter(@list, @i + 1)
};
.loopCenter(@makeCenters);
// antd default
h1, h2, h3, h4, h5, h6 {
color: #6B778C;
}
.@{prefix}-margin_content {
.center-margin;
width: 1190px;
margin-left: auto;
margin-right: auto;
}
.@{prefix}-content1024 {
.center-margin;
width: 1024px;
margin-left: auto;
margin-right: auto;
}
src/global/styles/mixins/font.less
0 → 100644
View file @
3fcaf2ac
src/global/styles/mixins/layout.less
0 → 100644
View file @
3fcaf2ac
/**
* @description 布局类
* @author xjm
*/
// ------------ 容器container ------------
.make-container(@pad-x: @padding-lg) {
width: 100%;
.make-center(block);
}
.make-container(@pad-x) when not (@pad-x = none) {
padding-left: @pad-x;
padding-right: @pad-x;
}
// ------------ 居中相关 center ------------
.make-center(@type:text) {}
.make-center(@type) when (@type = text) {
text-align: center;
}
.make-center(@type) when (@type = margin) {
margin-left: auto;
margin-right: auto;
}
.make-center(@type) when (@type = block) {
.make-center(center);
display: block;
}
.make-center(@type) when (@type = flex) {
display: flex;
justify-content: center;
align-items: center;
}
.make-center(@type) when (@type = flexAlign) {
display: flex;
align-items: center;
}
.make-center(@type) when (@type = flexJustify) {
display: flex;
justify-content: center;
}
.make-center(@type) when (@type = absolute), (@type = fixed) {
position: @type;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment