-
-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
postcss-preset-env : more documentation and a few fixes #313
Merged
Antonio-Laguna
merged 8 commits into
main
from
postcss-preset-env-some-fixes--philosophical-grey-mouse-lemur-97e4054681
Mar 19, 2022
Merged
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
7bd7c47
some fixes
romainmenke 5b28e10
more docs
romainmenke 75bfc12
add quick start section
romainmenke cb5b2a6
revert
romainmenke 67450d9
id first and sorted
romainmenke 912083e
tweak
romainmenke c75717a
table heading text alignment
romainmenke 05066e1
table heading text alignment
romainmenke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# List of features in PostCSS Preset Env | ||
|
||
The `ID` listed is the key for PostCSS Preset Env configuration in your project. | ||
|
||
| Name | ID | example | docs | | ||
| --- | --- | --- | --- | | ||
| `:blank` Empty-Value Pseudo-Class | `blank-pseudo-class` | [example](https://preset-env.cssdb.org/features/#blank-pseudo-class) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/css-blank-pseudo#readme) | | ||
| `:has()` Relational Pseudo-Class | `has-pseudo-class` | [example](https://preset-env.cssdb.org/features/#has-pseudo-class) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/css-has-pseudo#readme) | | ||
| `prefers-color-scheme` Media Query | `prefers-color-scheme-query` | [example](https://preset-env.cssdb.org/features/#prefers-color-scheme-query) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/css-prefers-color-scheme#readme) | | ||
| Case-Insensitive Attributes | `case-insensitive-attributes` | [example](https://preset-env.cssdb.org/features/#case-insensitive-attributes) | [docs](https://github.com/Semigradsky/postcss-attribute-case-insensitive#readme) | | ||
| `clamp` Function | `clamp` | [example](https://preset-env.cssdb.org/features/#clamp) | [docs](https://github.com/polemius/postcss-clamp#readme) | | ||
| `color()` Function | `color-function` | [example](https://preset-env.cssdb.org/features/#color-function) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-function#readme) | | ||
| Color Functional Notation | `color-functional-notation` | [example](https://preset-env.cssdb.org/features/#color-functional-notation) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-functional-notation#readme) | | ||
| Hexadecimal Alpha Notation | `hexadecimal-alpha-notation` | [example](https://preset-env.cssdb.org/features/#hexadecimal-alpha-notation) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-hex-alpha#readme) | | ||
| `rebeccapurple` Color | `rebeccapurple-color` | [example](https://preset-env.cssdb.org/features/#rebeccapurple-color) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-rebeccapurple#readme) | | ||
| Custom Media Queries | `custom-media-queries` | [example](https://preset-env.cssdb.org/features/#custom-media-queries) | [docs](https://github.com/postcss/postcss-custom-media#readme) | | ||
| Custom Properties | `custom-properties` | [example](https://preset-env.cssdb.org/features/#custom-properties) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-custom-properties#readme) | | ||
| Custom Selectors | `custom-selectors` | [example](https://preset-env.cssdb.org/features/#custom-selectors) | [docs](https://github.com/postcss/postcss-custom-selectors#readme) | | ||
| `:dir` Directionality Pseudo-Class | `dir-pseudo-class` | [example](https://preset-env.cssdb.org/features/#dir-pseudo-class) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-dir-pseudo-class#readme) | | ||
| Double Position Gradients | `double-position-gradients` | [example](https://preset-env.cssdb.org/features/#double-position-gradients) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-double-position-gradients#readme) | | ||
| Custom Environment Variables | `environment-variables` | [example](https://preset-env.cssdb.org/features/#environment-variables) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-env-function#readme) | | ||
| `:focus-visible` Focus-Indicated Pseudo-Class | `focus-visible-pseudo-class` | [example](https://preset-env.cssdb.org/features/#focus-visible-pseudo-class) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-focus-visible#readme) | | ||
| `:focus-within` Focus Container Pseudo-Class | `focus-within-pseudo-class` | [example](https://preset-env.cssdb.org/features/#focus-within-pseudo-class) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-focus-within#readme) | | ||
| Font `format()` Keywords | `font-format-keywords` | [example](https://preset-env.cssdb.org/features/#font-format-keywords) | [docs](https://github.com/valtlai/postcss-font-format-keywords#readme) | | ||
| `font-variant` Property | `font-variant-property` | [example](https://preset-env.cssdb.org/features/#font-variant-property) | [docs](https://github.com/postcss/postcss-font-variant#readme) | | ||
| Gap Properties | `gap-properties` | [example](https://preset-env.cssdb.org/features/#gap-properties) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-gap-properties#readme) | | ||
| `hwb()` Function | `hwb-function` | [example](https://preset-env.cssdb.org/features/#hwb-function) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-hwb-function#readme) | | ||
| `ic` length unit | `ic-unit` | [example](https://preset-env.cssdb.org/features/#ic-unit) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-ic-unit#readme) | | ||
| `image-set()` Function | `image-set-function` | [example](https://preset-env.cssdb.org/features/#image-set-function) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-image-set-function#readme) | | ||
| `all` Property | `all-property` | [example](https://preset-env.cssdb.org/features/#all-property) | [docs](https://github.com/maximkoretskiy/postcss-initial#readme) | | ||
| `:is()` Matches-Any Pseudo-Class | `is-pseudo-class` | [example](https://preset-env.cssdb.org/features/#is-pseudo-class) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-is-pseudo-class#readme) | | ||
| `lab()` Function | `lab-function` | [example](https://preset-env.cssdb.org/features/#lab-function) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-lab-function#readme) | | ||
| Logical Properties and Values | `logical-properties-and-values` | [example](https://preset-env.cssdb.org/features/#logical-properties-and-values) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-logical#readme) | | ||
| Media Query Ranges | `media-query-ranges` | [example](https://preset-env.cssdb.org/features/#media-query-ranges) | [docs](https://github.com/postcss/postcss-media-minmax#readme) | | ||
| Nesting Rules | `nesting-rules` | [example](https://preset-env.cssdb.org/features/#nesting-rules) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-nesting#readme) | | ||
| Two values syntax for `display` | `display-two-values` | [example](https://preset-env.cssdb.org/features/#display-two-values) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-normalize-display-values#readme) | | ||
| `oklab` and `oklch` color functions | `oklab-function` | [example](https://preset-env.cssdb.org/features/#oklab-function) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-oklab-function#readme) | | ||
| Support for percentages for `opacity` | `opacity-percentage` | [example](https://preset-env.cssdb.org/features/#opacity-percentage) | [docs](https://github.com/mrcgrtz/postcss-opacity-percentage#readme) | | ||
| `overflow` Shorthand Property | `overflow-property` | [example](https://preset-env.cssdb.org/features/#overflow-property) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-overflow-shorthand#readme) | | ||
| Break Properties | `break-properties` | [example](https://preset-env.cssdb.org/features/#break-properties) | [docs](https://github.com/shrpne/postcss-page-break#readme) | | ||
| Place Properties | `place-properties` | [example](https://preset-env.cssdb.org/features/#place-properties) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-place#readme) | | ||
| `:any-link` Hyperlink Pseudo-Class | `any-link-pseudo-class` | [example](https://preset-env.cssdb.org/features/#any-link-pseudo-class) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-pseudo-class-any-link#readme) | | ||
| `overflow-wrap` Property | `overflow-wrap-property` | [example](https://preset-env.cssdb.org/features/#overflow-wrap-property) | [docs](https://github.com/mattdimu/postcss-replace-overflow-wrap#readme) | | ||
| `:not()` Negation List Pseudo-Class | `not-pseudo-class` | [example](https://preset-env.cssdb.org/features/#not-pseudo-class) | [docs](https://github.com/postcss/postcss-selector-not#readme) | | ||
| `system-ui` Font Family | `system-ui-font-family` | [example](https://preset-env.cssdb.org/features/#system-ui-font-family) | [docs](https://github.com/JLHwung/postcss-font-family-system-ui#readme) | | ||
|
||
|
||
------- | ||
|
||
Manually enable a feature : | ||
|
||
```js | ||
postcssPresetEnv({ | ||
features: { | ||
'<ID>': true | ||
} | ||
}) | ||
``` | ||
|
||
Or disable one : | ||
|
||
```js | ||
postcssPresetEnv({ | ||
features: { | ||
'<ID>': false | ||
} | ||
}) | ||
``` | ||
|
||
Set feature options : | ||
|
||
```js | ||
postcssPresetEnv({ | ||
features: { | ||
'<ID>': { | ||
preserve: false | ||
} | ||
} | ||
}) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# List of features in PostCSS Preset Env | ||
|
||
The `ID` listed is the key for PostCSS Preset Env configuration in your project. | ||
|
||
<featuresTable> | ||
|
||
------- | ||
|
||
Manually enable a feature : | ||
|
||
```js | ||
postcssPresetEnv({ | ||
features: { | ||
'<ID>': true | ||
} | ||
}) | ||
``` | ||
|
||
Or disable one : | ||
|
||
```js | ||
postcssPresetEnv({ | ||
features: { | ||
'<ID>': false | ||
} | ||
}) | ||
``` | ||
|
||
Set feature options : | ||
|
||
```js | ||
postcssPresetEnv({ | ||
features: { | ||
'<ID>': { | ||
preserve: false | ||
} | ||
} | ||
}) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { packageNamesToIds } from '../src/plugins/plugins-map.mjs'; | ||
import cssdb from 'cssdb'; | ||
import { promises as fsp } from 'fs'; | ||
|
||
let featuresTable = ''; | ||
|
||
featuresTable = featuresTable + '| Name | ID | example | docs |\n'; | ||
featuresTable = featuresTable + '| --- | --- | --- | --- |\n'; | ||
for (const id of Object.values(packageNamesToIds)) { | ||
const cssdbFeature = cssdb.find(feature => feature.id === id); | ||
const cssdbPlugins = cssdbFeature.polyfills.filter(polyfill => polyfill.type === 'PostCSS Plugin'); | ||
cssdbPlugins.sort((a) => { | ||
if (a.link.includes('https://github.com/csstools')) { | ||
return -1; | ||
} | ||
|
||
if (a.link.includes('https://github.com/postcss')) { | ||
return -1; | ||
} | ||
|
||
return 1; | ||
}); | ||
|
||
featuresTable = featuresTable + `| ${cssdbFeature.title} `; | ||
featuresTable = featuresTable + `| \`${id}\` `; | ||
featuresTable = featuresTable + `| [example](https://preset-env.cssdb.org/features/#${id}) `; | ||
featuresTable = featuresTable + `| [docs](${cssdbPlugins[0].link}#readme) |\n`; | ||
} | ||
|
||
let featuresDoc = (await fsp.readFile('./docs/FEATURES.md', 'utf8')).toString(); | ||
featuresDoc = featuresDoc.replaceAll('<featuresTable>', featuresTable); | ||
|
||
fsp.writeFile('FEATURES.md', featuresDoc, 'utf8'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
126 changes: 0 additions & 126 deletions
126
plugin-packs/postcss-preset-env/src/patch/postcss-clamp.mjs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eslint
was nagging about top levelasync await
.