Skip to content

Commit 3e5be94

Browse files
Wire logical into Preset Env and CLI (#798)
* remove extra space * remove plugin-options for logical * include new logical plugins * minor format * removing redundant if within shared-options * adding shared logical options to preset-env options * ensuring logical options get passed * updating tests * adding tests for logical options * removing wrong object * adding test for logical * adding clear and resize to the CHANGELOG * updating tests and built files * Updating CSSDB * Generating FEATURES * update CHANGELOG and README * Updating tests for ratios * Adding missing example * Updating CLI * rebuild * a few tweaks and some more tests Co-authored-by: Romain Menke <[email protected]> Co-authored-by: Romain Menke <[email protected]>
1 parent f428f3a commit 3e5be94

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1307
-144
lines changed

cli/csstools-cli/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
- Updated: Support for Node v14+ (major).
66
- Remove `postcss-env-function` (breaking).
77
- Remove `importFrom` and `exportTo` plugin options (breaking).
8+
- Added `@csstools/postcss-logical-float-and-clear`
9+
- Added `@csstools/postcss-logical-resize`
10+
- Added `@csstools/postcss-logical-viewport-units`
811

912
### 1.4.0 (June 3, 2022)
1013

cli/csstools-cli/dist/cli.cjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

cli/csstools-cli/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
"@csstools/postcss-hwb-function": "^1.0.1",
3939
"@csstools/postcss-ic-unit": "^1.0.0",
4040
"@csstools/postcss-is-pseudo-class": "^2.0.4",
41+
"@csstools/postcss-logical-float-and-clear": "^1.0.0",
42+
"@csstools/postcss-logical-resize": "^1.0.0",
43+
"@csstools/postcss-logical-viewport-units": "^1.0.0",
4144
"@csstools/postcss-normalize-display-values": "^1.0.0",
4245
"@csstools/postcss-oklab-function": "^1.1.0",
4346
"@csstools/postcss-stepped-value-functions": "^1.0.0",

cli/csstools-cli/src/cli.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ import postcssImageSetFunction from './plugins/postcss-image-set-function';
2222
import postcssIsPseudoClass from './plugins/postcss-is-pseudo-class';
2323
import postcssLabFunction from './plugins/postcss-lab-function';
2424
import postcssLogical from './plugins/postcss-logical';
25+
import postcssLogicalFloatAndClear from './plugins/postcss-logical-float-and-clear';
26+
import postcssLogicalResize from './plugins/postcss-logical-resize';
27+
import postcssLogicalViewportUnits from './plugins/postcss-logical-viewport-units';
2528
import postcssNesting from './plugins/postcss-nesting';
2629
import postcssNormalizeDisplayValues from './plugins/postcss-normalize-display-values';
2730
import postcssOKLabFunction from './plugins/postcss-oklab-function';
@@ -109,6 +112,15 @@ function main() {
109112
case 'postcss-logical':
110113
postcssLogical();
111114
return;
115+
case 'postcss-logical-float-and-clear':
116+
postcssLogicalFloatAndClear();
117+
return;
118+
case 'postcss-logical-resize':
119+
postcssLogicalResize();
120+
return;
121+
case 'postcss-logical-viewport-units':
122+
postcssLogicalViewportUnits();
123+
return;
112124
case 'postcss-nesting':
113125
postcssNesting();
114126
return;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import plugin from '@csstools/postcss-logical-float-and-clear';
2+
import { cli, helpTextLogger } from '@csstools/base-cli';
3+
4+
export default function postcssLogical() {
5+
cli(
6+
plugin,
7+
['inlineDirection', 'blockDirection'],
8+
helpTextLogger(
9+
'@csstools/cli postcss-logical-float-and-clear',
10+
'PostCSS Logical Float And Clear',
11+
'Lets you use flow-relative (inline-start and inline-end) values for float and clear, following the CSS Logical Properties and Values specification.',
12+
{
13+
inlineDirection: 'left-to-right',
14+
},
15+
),
16+
false,
17+
);
18+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import plugin from '@csstools/postcss-logical-resize';
2+
import { cli, helpTextLogger } from '@csstools/base-cli';
3+
4+
export default function postcssLogicalResize() {
5+
cli(
6+
plugin,
7+
['inlineDirection'],
8+
helpTextLogger(
9+
'@csstools/cli postcss-logical-resize',
10+
'PostCSS Logical Resize',
11+
'Lets you use logical values in the resize property, following the CSS Logical Properties and Values specification.',
12+
{
13+
inlineDirection: 'left-to-right',
14+
},
15+
),
16+
false,
17+
);
18+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import plugin from '@csstools/postcss-logical-viewport-units';
2+
import { cli, helpTextLogger } from '@csstools/base-cli';
3+
4+
export default function postcssLogicalViewportUnits() {
5+
cli(
6+
plugin,
7+
['inlineDirection', 'preserve'],
8+
helpTextLogger(
9+
'@csstools/cli postcss-viewport-units',
10+
'PostCSS Logical Viewport Units',
11+
'Lets you use vb and vi length units in CSS, following the CSS Values and Units Module Level 4 specification.',
12+
{
13+
inlineDirection: 'left-to-right',
14+
preserve: true,
15+
},
16+
),
17+
false,
18+
);
19+
}

cli/csstools-cli/src/plugins/postcss-logical.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ import { cli, helpTextLogger } from '@csstools/base-cli';
44
export default function postcssLogical() {
55
cli(
66
plugin,
7-
['dir', 'preserve'],
7+
['inlineDirection', 'blockDirection'],
88
helpTextLogger(
99
'@csstools/cli postcss-logical',
1010
'PostCSS Logical',
1111
'Lets you use logical, rather than physical, direction and dimension mappings in CSS, following the CSS Logical Properties and Values specification.',
1212
{
13-
dir: 'ltr|rtl',
14-
preserve: true,
13+
inlineDirection: 'left-to-right',
14+
blockDirection: 'top-to-bottom',
1515
},
1616
),
1717
false,

package-lock.json

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

plugin-packs/postcss-preset-env/.tape.mjs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,15 @@ postcssTape(plugin)({
167167
browsers: '> 0%'
168168
},
169169
},
170+
'basic:hebrew': {
171+
message: 'supports { logical: { inlineDirection: "right-to-left" }, stage: 0, browsers: "> 0%" } usage',
172+
options: {
173+
stage: 0,
174+
logical: {
175+
inlineDirection: 'right-to-left'
176+
}
177+
},
178+
},
170179
'layers-basic': {
171180
message: 'supports layers usage',
172181
options: {
@@ -268,9 +277,6 @@ postcssTape(plugin)({
268277
message: 'supports { insertBefore } usage when looking for source',
269278
options: {
270279
stage: 0,
271-
features: {
272-
'lab-function': true
273-
},
274280
features: {
275281
'lab-function': true,
276282
'color-function': false,
@@ -288,9 +294,6 @@ postcssTape(plugin)({
288294
message: 'supports { insertBefore } usage when looking for a result',
289295
options: {
290296
stage: 0,
291-
features: {
292-
'lab-function': true
293-
},
294297
features: {
295298
'lab-function': true,
296299
'color-function': false,

0 commit comments

Comments
 (0)