Skip to content

Commit

Permalink
additional step for ma8, w6, br4
Browse files Browse the repository at this point in the history
  • Loading branch information
fab1an committed Jan 20, 2017
1 parent 446fbc7 commit 2d79b7d
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 25 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 3.1
* added additional step for margins, paddings, heights and widths for `32rem`
* added additional step `br5`

### 3.0.3
* updated dependencies, fix #28

Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,21 +136,21 @@ ass alignSelf: "stretch"

##### Margins & Paddings [(Scale)](http://tachyons.io/docs/layout/spacing/)
```javascript
ma0 ... ma7 margin: 0|0.25|0.5|1|2|4|8|16 rem
ml|mr|mb|mt [0-7] marginLeft, marginRight, marginBottom, marginTop
mh [0-7] marginHorizontal
mv [0-7] marginVertical
ma0 ... ma8 margin: 0|0.25|0.5|1|2|4|8|16|32 rem
ml|mr|mb|mt [0-8] marginLeft, marginRight, marginBottom, marginTop
mh [0-8] marginHorizontal
mv [0-8] marginVertical
/* Same with p for padding */
```

##### Heights & Widths
```javascript
h1 ... h5 height: 1|2|4|8|16 rem
w1 ... w5 width: 1|2|4|8|16 rem
h1 ... h6 height: 1|2|4|8|16|32 rem
w1 ... w6 width: 1|2|4|8|16|32 rem
min-h1 ... min-h5 minHeight: 1|2|4|8|16 rem
max-h1 ... max-h5 maxHeight: 1|2|4|8|16 rem
min-h1 ... min-h6 minHeight: 1|2|4|8|16|32 rem
max-h1 ... max-h6 maxHeight: 1|2|4|8|16|32 rem
/* Same with w for width */
Expand All @@ -162,7 +162,7 @@ absolute-fill position: absolute, top/left/right/bottom: 0
ba borderWidth: 1
bl|br|bt|bb borderLeftWidth: 1 | borderRightWidth: 1...
br0 ... br4 borderRadius: 0|0.125|0.25|0.5|1 rem
br0 ... br5 borderRadius: 0|0.125|0.25|0.5|1]2 rem
br--bottom bottom radius only
br--top top radius only
br--right right radius only
Expand Down
3 changes: 2 additions & 1 deletion lib/styles/borders.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ var radii = exports.radii = _lodash2.default.mapValues({
br1: 0.125,
br2: 0.25,
br3: 0.5,
br4: 1
br4: 1,
br5: 2
}, function (val) {
return { borderRadius: val };
});
Expand Down
9 changes: 6 additions & 3 deletions lib/styles/heights.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ var heights = exports.heights = _lodash2.default.mapValues({
h2: 2,
h3: 4,
h4: 8,
h5: 16
h5: 16,
h6: 32
}, function (val) {
return { height: val };
});
Expand All @@ -26,7 +27,8 @@ var maxHeights = exports.maxHeights = _lodash2.default.mapValues({
"max-h2": 2,
"max-h3": 4,
"max-h4": 8,
"max-h5": 16
"max-h5": 16,
"max-h6": 32
}, function (val) {
return { maxHeight: val };
});
Expand All @@ -36,7 +38,8 @@ var minHeights = exports.minHeights = _lodash2.default.mapValues({
"min-h2": 2,
"min-h3": 4,
"min-h4": 8,
"min-h5": 16
"min-h5": 16,
"max-h6": 32
}, function (val) {
return { minHeight: val };
});
2 changes: 1 addition & 1 deletion lib/styles/spacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var REM_SCALE = [0, 0.25, 0.5, 1, 2, 4, 8, 16];
var REM_SCALE = [0, 0.25, 0.5, 1, 2, 4, 8, 16, 32];

var what = _lodash2.default.toPairs({
m: "margin",
Expand Down
9 changes: 6 additions & 3 deletions lib/styles/widths.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ var widths = exports.widths = _lodash2.default.mapValues({
w2: 2,
w3: 4,
w4: 8,
w5: 16
w5: 16,
w6: 32
}, function (val) {
return { width: val };
});
Expand All @@ -26,7 +27,8 @@ var maxWidths = exports.maxWidths = _lodash2.default.mapValues({
"max-w2": 2,
"max-w3": 4,
"max-w4": 8,
"max-w5": 16
"max-w5": 16,
"max-w6": 32
}, function (val) {
return { maxWidth: val };
});
Expand All @@ -36,7 +38,8 @@ var minWidths = exports.minWidths = _lodash2.default.mapValues({
"min-w2": 2,
"min-w3": 4,
"min-w4": 8,
"min-w5": 16
"min-w5": 16,
"min-w6": 32
}, function (val) {
return { minWidth: val };
});
3 changes: 2 additions & 1 deletion src/styles/borders.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ export const radii = _.mapValues({
br1: 0.125,
br2: 0.25,
br3: 0.5,
br4: 1
br4: 1,
br5: 2
}, val => ({ borderRadius: val }));

export const styles = {
Expand Down
9 changes: 6 additions & 3 deletions src/styles/heights.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,24 @@ export const heights = _.mapValues({
h2: 2,
h3: 4,
h4: 8,
h5: 16
h5: 16,
h6: 32
}, val => ({ height: val }))

export const maxHeights = _.mapValues({
"max-h1": 1,
"max-h2": 2,
"max-h3": 4,
"max-h4": 8,
"max-h5": 16
"max-h5": 16,
"max-h6": 32
}, val => ({ maxHeight: val }))

export const minHeights = _.mapValues({
"min-h1": 1,
"min-h2": 2,
"min-h3": 4,
"min-h4": 8,
"min-h5": 16
"min-h5": 16,
"max-h6": 32
}, val => ({ minHeight: val }))
2 changes: 1 addition & 1 deletion src/styles/spacing.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import _ from "lodash";

const REM_SCALE = [0, 0.25, 0.5, 1, 2, 4, 8, 16];
const REM_SCALE = [0, 0.25, 0.5, 1, 2, 4, 8, 16, 32];

const what = _.toPairs({
m: "margin",
Expand Down
9 changes: 6 additions & 3 deletions src/styles/widths.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,24 @@ export const widths = _.mapValues({
w2: 2,
w3: 4,
w4: 8,
w5: 16
w5: 16,
w6: 32
}, val => ({ width: val }))

export const maxWidths = _.mapValues({
"max-w1": 1,
"max-w2": 2,
"max-w3": 4,
"max-w4": 8,
"max-w5": 16
"max-w5": 16,
"max-w6": 32
}, val => ({ maxWidth: val }))

export const minWidths = _.mapValues({
"min-w1": 1,
"min-w2": 2,
"min-w3": 4,
"min-w4": 8,
"min-w5": 16
"min-w5": 16,
"min-w6": 32
}, val => ({ minWidth: val }))

0 comments on commit 2d79b7d

Please sign in to comment.