Skip to content

Commit 06936be

Browse files
author
anthinkingcoder
committed
update readme.md
1 parent 446e147 commit 06936be

File tree

8 files changed

+122
-27
lines changed

8 files changed

+122
-27
lines changed

.postcssrc.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ module.exports = {
55
"postcss-import": {},
66
"postcss-url": {},
77
// to edit target browsers: use "browserslist" field in package.json
8-
"autoprefixer": {}
8+
"autoprefixer": {},
9+
"postcss-write-svg": {},
10+
"postcss-px-to-viewport": {
11+
}
912
}
1013
}

README.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
# simple-grid
2-
> a simple grid layout
2+
> a simple grid layout(Vue Component)
33
4-
> to install it
5-
6-
> npm i simple-xgrid --save
7-
8-
> to use it
9-
10-
> import Grid from 'simple-xgrid'
4+
```bash
5+
npm i simple-xgrid --save
6+
import Grid from 'simple-xgrid'
7+
Vue.use(Grid);
8+
```
119

12-
> Vue.use(Grid);
1310
## 1.examples
1411
```html
1512
<Row>
@@ -109,5 +106,5 @@
109106
</Col>
110107
</Row>
111108
```
112-
## 2.效果
109+
## 2.result
113110
![](http://ofn22jfef.bkt.clouddn.com/grid.png)

gulpfile.js

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

package-lock.json

Lines changed: 73 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@
4242
"portfinder": "^1.0.13",
4343
"postcss-import": "^11.0.0",
4444
"postcss-loader": "^2.0.8",
45+
"postcss-px-to-viewport": "0.0.3",
4546
"postcss-url": "^7.2.1",
47+
"postcss-write-svg": "github:jonathantneal/postcss-write-svg",
4648
"rimraf": "^2.6.0",
4749
"semver": "^5.3.0",
4850
"shelljs": "^0.7.6",

src/App.vue

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,19 @@
9898
order:3
9999
</Col>
100100
</Row>
101+
<div class="example">
102+
103+
</div>
104+
<div w-188-246>
105+
106+
</div>
107+
<div w-187-246>
108+
109+
</div>
110+
111+
<div class="content">
112+
113+
</div>
101114
</div>
102115
</template>
103116
<script>

src/components/row.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,14 @@
7676
}
7777
}
7878
</script>
79-
8079
<!-- Add "scoped" attribute to limit CSS to this component only -->
81-
<style lang="sass">
80+
<style>
81+
/*@svg 1px-border {*/
82+
/*height: 2px;*/
83+
/*@rect {*/
84+
/*fill: var(--color, black);*/
85+
/*width: 100%;*/
86+
/*height: 50%;*/
87+
/*}*/
88+
/*}*/
8289
</style>

src/styles/grid.scss

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ $prefix: '.simple';
22
$rowPrefix: '#{$prefix}-row';
33
$colPrefix: '#{$prefix}-col';
44
$flexRowPrefix: '#{$rowPrefix}-flex';
5-
$flexJustifies: ('start','end','center','space-around','space-between');
6-
$flexAligns: ('top':'flex-start','middle':'center','bottom':'flex-end');
5+
$flexJustifies: ('start', 'end', 'center', 'space-around', 'space-between');
6+
$flexAligns: ('top':'flex-start', 'middle':'center', 'bottom':'flex-end');
77
$gridCol: 24;
88
@mixin generate-row {
99
#{$rowPrefix} {
@@ -23,20 +23,21 @@ $gridCol: 24;
2323
display: block;
2424
position: relative;
2525
}
26-
#{$flexRowPrefix},#{$flexRowPrefix},#{$colPrefix} {
26+
#{$flexRowPrefix}, #{$flexRowPrefix}, #{$colPrefix} {
2727
box-sizing: border-box;
2828
}
2929
@each $justify in $flexJustifies {
3030
#{$flexRowPrefix}-#{$justify} {
3131
justify-content: #{$justify};
3232
}
3333
}
34-
@each $key,$value in $flexAligns {
34+
@each $key, $value in $flexAligns {
3535
#{$flexRowPrefix}-#{$key} {
3636
align-items: #{$value};
3737
}
3838
}
3939
}
40+
4041
@mixin generate-float-col($viewport:'') {
4142
$cols: '#{$colPrefix}-span#{$viewport}-1';
4243
@for $i from 2 through $gridCol {
@@ -47,6 +48,7 @@ $gridCol: 24;
4748
flex: 0 0 auto;
4849
}
4950
}
51+
5052
@mixin generate-col($viewport: '') {
5153
@for $i from 1 through $gridCol {
5254
#{$colPrefix}-span#{$viewport}-#{$i} {
@@ -66,21 +68,26 @@ $gridCol: 24;
6668
}
6769
}
6870
}
71+
6972
@mixin generate-grid($viewport) {
7073
@include generate-float-col($viewport);
7174
@include generate-col($viewport);
7275
}
76+
7377
@include generate-row();
7478
@include generate-grid('');
7579
@media (max-width: 768px) {
7680
@include generate-grid('-xs');
7781
}
82+
7883
@media (min-width: 768px) {
7984
@include generate-grid('-sm');
8085
}
86+
8187
@media (min-width: 992px) {
8288
@include generate-grid('-md');
8389
}
90+
8491
@media (min-width: 1200px) {
8592
@include generate-grid('-lg');
8693
}
@@ -93,3 +100,6 @@ $gridCol: 24;
93100

94101

95102

103+
104+
105+

0 commit comments

Comments
 (0)