Skip to content

Commit 9c4b381

Browse files
committed
Changing name css var | Fix rollup settings
1 parent e2bde88 commit 9c4b381

File tree

3 files changed

+31
-29
lines changed

3 files changed

+31
-29
lines changed

rollup.config.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import vue from 'rollup-plugin-vue';
77
import replace from 'rollup-plugin-replace';
88
import pkg from './package.json';
99

10+
const watch = process.env.ROLLUP_WATCH;
11+
1012
const app = {
1113
input: 'docs/main.js',
1214
output: {
@@ -20,9 +22,9 @@ const app = {
2022
babel({ exclude: 'node_modules/**' }),
2123
resolve({ mainFields: ['module', 'jsnext', 'main', 'browser'] }),
2224
commonjs(),
23-
serve(),
24-
livereload('public'),
25-
terser(),
25+
watch && serve(),
26+
watch && livereload('public'),
27+
!watch && terser(),
2628
replace({
2729
'process.env.NODE_ENV': JSON.stringify('development'),
2830
'process.env.VUE_ENV': JSON.stringify('browser')
@@ -103,6 +105,6 @@ function serve() {
103105
};
104106
}
105107

106-
const config = process.env.ROLLUP_WATCH ? app : library;
108+
const config = watch ? app : [...library, app];
107109

108110
export default config;

src/Column.vue

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ export default {
1111
let styleGeneral = this.createStyleSize();
1212
1313
if (this.xs || this.sm || this.md || this.lg || this.xl) {
14-
styleGeneral += `--colFlexSGR:0;`;
14+
styleGeneral += `--colFlexVGR:0;`;
1515
} else {
16-
styleGeneral = `--colFlexSGR:1;`;
16+
styleGeneral = `--colFlexVGR:1;`;
1717
}
1818
1919
return {
@@ -51,12 +51,12 @@ export default {
5151
let newStyle = '';
5252
5353
newStyle += this.xs
54-
? `--xsWidthSGR:${this.getValue(this.xs)}; `
55-
: `--xsWidthSGR:100%; `;
56-
newStyle += this.sm ? `--smWidthSGR:${this.getValue(this.sm)}; ` : '';
57-
newStyle += this.md ? `--mdWidthSGR:${this.getValue(this.md)}; ` : '';
58-
newStyle += this.lg ? `--lgWidthSGR:${this.getValue(this.lg)}; ` : '';
59-
newStyle += this.xl ? `--xlWidthSGR:${this.getValue(this.xl)}; ` : '';
54+
? `--xsWidthVGR:${this.getValue(this.xs)}; `
55+
: `--xsWidthVGR:100%; `;
56+
newStyle += this.sm ? `--smWidthVGR:${this.getValue(this.sm)}; ` : '';
57+
newStyle += this.md ? `--mdWidthVGR:${this.getValue(this.md)}; ` : '';
58+
newStyle += this.lg ? `--lgWidthVGR:${this.getValue(this.lg)}; ` : '';
59+
newStyle += this.xl ? `--xlWidthVGR:${this.getValue(this.xl)}; ` : '';
6060
6161
return newStyle;
6262
}
@@ -69,45 +69,45 @@ export default {
6969
box-sizing: border-box;
7070
display: flex;
7171
flex-wrap: wrap;
72-
width: calc(100% + (var(--paddingSGR) * 2));
73-
margin: var(--marginSGR);
72+
width: calc(100% + (var(--paddingVGR) * 2));
73+
margin: var(--marginVGR);
7474
}
7575
7676
.col {
7777
position: relative;
7878
box-sizing: border-box;
79-
flex-grow: var(--colFlexSGR);
80-
padding: var(--paddingSGR);
79+
flex-grow: var(--colFlexVGR);
80+
padding: var(--paddingVGR);
8181
}
8282
.col-xs {
83-
flex-basis: var(--xsWidthSGR);
84-
max-width: var(--xsWidthSGR);
83+
flex-basis: var(--xsWidthVGR);
84+
max-width: var(--xsWidthVGR);
8585
}
8686
8787
@media (min-width: 576px) {
8888
.col-sm {
89-
flex-basis: var(--smWidthSGR);
90-
max-width: var(--smWidthSGR);
89+
flex-basis: var(--smWidthVGR);
90+
max-width: var(--smWidthVGR);
9191
}
9292
}
9393
9494
@media (min-width: 768px) {
9595
.col-md {
96-
flex-basis: var(--mdWidthSGR);
97-
max-width: var(--mdWidthSGR);
96+
flex-basis: var(--mdWidthVGR);
97+
max-width: var(--mdWidthVGR);
9898
}
9999
}
100100
101101
@media (min-width: 992px) {
102102
.col-lg {
103-
flex-basis: var(--lgWidthSGR);
104-
max-width: var(--lgWidthSGR);
103+
flex-basis: var(--lgWidthVGR);
104+
max-width: var(--lgWidthVGR);
105105
}
106106
}
107107
108108
@media (min-width: 1200px) {
109109
.col-xl {
110-
max-width: var(--xlWidthSGR);
110+
max-width: var(--xlWidthVGR);
111111
}
112112
}
113113
</style>

src/Row.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ export default {
2222
methods: {
2323
createGutter(gutter) {
2424
return gutter
25-
? `--paddingSGR:${gutter / 2}px;--marginSGR:-${gutter / 2}px`
26-
: '--paddingSGR:0;--marginSGR:0';
25+
? `--paddingVGR:${gutter / 2}px;--marginVGR:-${gutter / 2}px`
26+
: '--paddingVGR:0;--marginVGR:0';
2727
}
2828
}
2929
};
@@ -34,7 +34,7 @@ export default {
3434
box-sizing: border-box;
3535
display: flex;
3636
flex-wrap: wrap;
37-
width: calc(100% + (var(--paddingSGR) * 2));
38-
margin: var(--marginSGR);
37+
width: calc(100% + (var(--paddingVGR) * 2));
38+
margin: var(--marginVGR);
3939
}
4040
</style>

0 commit comments

Comments
 (0)