Skip to content

Commit 1bbca4b

Browse files
M. Weberyadvr
authored andcommitted
style: create new .less files structure (#3)
Delete global.less file and split rules into several .less files inside new style folder. Upgrade import paths and write readme file that describes how less-coding could look like. Add missed npm package to fix terminal error. Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent 0ef07cd commit 1bbca4b

File tree

21 files changed

+1021
-788
lines changed

21 files changed

+1021
-788
lines changed

ui/package-lock.json

Lines changed: 756 additions & 582 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "1.3.0",
44
"private": true,
55
"scripts": {
6+
"start": "vue-cli-service serve",
67
"serve": "vue-cli-service serve",
78
"build": "vue-cli-service build",
89
"lint": "vue-cli-service lint",
@@ -23,6 +24,7 @@
2324
"lodash.pick": "^4.4.0",
2425
"md5": "^2.2.1",
2526
"moment": "^2.24.0",
27+
"node-emoji": "^1.10.0",
2628
"npm-check-updates": "^3.1.13",
2729
"nprogress": "^0.2.0",
2830
"viser-vue": "^2.4.6",

ui/src/components/FooterToolbar/index.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import "../index";
1+
@import "../../style/variables/prefixes";
22

33
@footer-toolbar-prefix-cls: ~"@{ant-pro-prefix}-footer-toolbar";
44

ui/src/components/MultiTab/index.less

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
1-
@import '../index';
1+
@import '../../style/variables/prefixes';
22

33
@multi-tab-prefix-cls: ~"@{ant-pro-prefix}-multi-tab";
44
@multi-tab-wrapper-prefix-cls: ~"@{ant-pro-prefix}-multi-tab-wrapper";
55

6-
/*
7-
.topmenu .@{multi-tab-prefix-cls} {
8-
max-width: 1200px;
9-
margin: -23px auto 24px auto;
10-
}
11-
*/
126
.@{multi-tab-prefix-cls} {
137
margin: -23px -24px 24px -24px;
148
background: #fff;

ui/src/components/NumberInfo/index.less

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
@import "../index";
1+
@import '~ant-design-vue/lib/style/themes/default';
2+
@import '../../style/variables/prefixes';
23

34
@numberInfo-prefix-cls: ~"@{ant-pro-prefix}-number-info";
45

ui/src/components/Trend/index.less

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
@import "../index";
1+
@import '~ant-design-vue/lib/style/themes/default';
2+
@import '../../style/variables/prefixes';
23

34
@trend-prefix-cls: ~"@{ant-pro-prefix}-trend";
45

ui/src/components/chart/chart.less

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,5 @@
66
position: absolute;
77
bottom: -28px;
88
width: 100%;
9-
10-
/* margin: 0 -5px;
11-
overflow: hidden;*/
129
}
1310
}

ui/src/components/index.less

Lines changed: 0 additions & 4 deletions
This file was deleted.

ui/src/components/layouts/BasicLayout.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ export default {
2626
</script>
2727

2828
<style lang="less">
29-
@import url('../global.less');
29+
@import url('../../style/index.less');
30+
3031
3132
/*
3233
* The following styles are auto-applied to elements with

ui/src/style/README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# index.less
2+
- src/styles/index.less imports all necessary rules for cloudstack
3+
4+
# ant .less structure node_modules/ant-design-vue/
5+
## main .less entry points:
6+
7+
1. dist/antd.less
8+
- imports everthing with index.less + components.less
9+
2. lib/style/index.less
10+
- themes/default.less
11+
- color/colors'
12+
- default theme @variables
13+
- core/index.less
14+
- includes base styles, motion rules and iconfont
15+
16+
# src/style/ explaination
17+
18+
- index.less includes ant styles, as well as all custom variables and rules
19+
20+
## folders:
21+
22+
1. variables
23+
- include all custom variables here
24+
2. common
25+
- include all rules that reset styles, define global stuffs without classes at all
26+
- e.g. body {} p, ul, li {} h1, h2, h3 {}
27+
3. frame
28+
- everything that belongs to the frame
29+
- e.g. header, footer, nav, sider, content (just the actual content frame, not every component in it)
30+
4. layout
31+
- rules that modify the page at all if new layout class is set.
32+
- e.g. #html class="layout-ant-black"#
33+
5. objects
34+
- repeatly used elements like buttons, inputs,
35+
6. components
36+
- complex elements like dropdown, forms, table, search (usualy include this to components/FooterToolbar/ folder)

0 commit comments

Comments
 (0)