Skip to content
This repository was archived by the owner on Feb 18, 2022. It is now read-only.

Commit 8d26b47

Browse files
committed
4.0.2
1 parent 80d5a09 commit 8d26b47

File tree

6 files changed

+39
-16
lines changed

6 files changed

+39
-16
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changes to PostCSS Logical Properties
22

3+
### 4.0.2 (June 10, 2019)
4+
5+
- Fixed: Restored transforms for `max-block-size`, `max-inline-size`,
6+
`min-block-size`, and `min-inline-size`.
7+
38
### 4.0.1 (June 10, 2019)
49

510
- Fixed: An issue with `block-size` and `inline-size` being miscalculated.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "postcss-logical",
3-
"version": "4.0.1",
3+
"version": "4.0.2",
44
"description": "Use logical properties and values in CSS",
55
"author": "Jonathan Neal <jonathantneal@hotmail.com>",
66
"license": "CC0-1.0",

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ const transforms = {
2323
'text-align': transformTextAlign,
2424

2525
// Logical Height and Logical Width
26-
'block-size': transformSize['block-size'],
27-
'inline-size': transformSize['inline-size'],
26+
'block-size': transformSize, 'max-block-size': transformSize, 'min-block-size': transformSize,
27+
'inline-size': transformSize, 'max-inline-size': transformSize, 'min-inline-size': transformSize,
2828

2929
// Flow-relative Margins
3030
'margin': transformDirectionalShorthands, 'margin-inline': transformSide['inline'], 'margin-inline-end': transformSide['inline-end'], 'margin-inline-start': transformSide['inline-start'], 'margin-block': transformSide['block'], 'margin-block-end': transformSide['block-end'], 'margin-block-start': transformSide['block-start'],

src/lib/transform-size.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
export default {
2-
// block-size
3-
'block-size': decl => {
4-
decl.prop = 'height';
5-
},
6-
// inline-size
7-
'inline-size': decl => {
8-
decl.prop = 'width';
9-
}
1+
import matchSize from './match-size';
2+
3+
export default decl => {
4+
decl.prop = decl.prop.replace(
5+
matchSize,
6+
($0, minmax, flow) => `${minmax||''}${'block' === flow ? 'height' : 'width'}`
7+
);
108
}

test/size.css

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
test-size {
2-
block-size: auto;
3-
inline-size: auto;
2+
block-size: 320px;
3+
inline-size: 180px;
4+
}
5+
6+
text-max-size {
7+
max-block-size: 320px;
8+
max-inline-size: 180px;
9+
}
10+
11+
text-min-size {
12+
min-block-size: 320px;
13+
min-inline-size: 180px;
414
}

test/size.expect.css

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
test-size {
2-
height: auto;
3-
width: auto;
2+
height: 320px;
3+
width: 180px;
4+
}
5+
6+
text-max-size {
7+
max-height: 320px;
8+
max-width: 180px;
9+
}
10+
11+
text-min-size {
12+
min-height: 320px;
13+
min-width: 180px;
414
}

0 commit comments

Comments
 (0)