-
-
Notifications
You must be signed in to change notification settings - Fork 75
Updating Focus Visible #513
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
Merged
Antonio-Laguna
merged 6 commits into
postcss-preset-env--v8
from
feature/focus-visible-v8
Jul 1, 2022
Merged
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
01e24c7
Updating Focus Visible
Antonio-Laguna f3b821e
Returning CHANGELOG
Antonio-Laguna a1afc34
Updating tests
Antonio-Laguna 7aca779
focus-visible : code review (#514)
romainmenke 5297739
Updating CHANGELOG
Antonio-Laguna 7b074a0
focus-visible : code review (#514)
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 |
---|---|---|
@@ -1,12 +1,6 @@ | ||
node_modules | ||
dist | ||
package-lock.json | ||
yarn.lock | ||
*.log* | ||
*.result.css | ||
*.result.css.map | ||
!.editorconfig | ||
!.gitignore | ||
!.rollup.js | ||
!.tape.js | ||
!.travis.yml | ||
dist/* |
This file contains hidden or 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 hidden or 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 hidden or 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,88 @@ | ||
<!-- Available Variables: --> | ||
<!-- <humanReadableName> PostCSS Your Plugin --> | ||
<!-- <exportName> postcssYourPlugin --> | ||
<!-- <packageName> @csstools/postcss-your-plugin --> | ||
<!-- <packageVersion> 1.0.0 --> | ||
<!-- <packagePath> plugins/postcss-your-plugin --> | ||
<!-- <cssdbId> your-feature --> | ||
<!-- <specUrl> https://www.w3.org/TR/css-color-4/#funcdef-color --> | ||
<!-- <example.css> file contents for examples/example.css --> | ||
<!-- <header> --> | ||
<!-- <usage> usage instructions --> | ||
<!-- <envSupport> --> | ||
<!-- <corsWarning> --> | ||
<!-- <linkList> --> | ||
<!-- to generate : npm run docs --> | ||
|
||
<header> | ||
|
||
[<humanReadableName>] lets you use the `:focus-visible` pseudo-class in CSS, | ||
following the [Selectors Level 4 specification]. | ||
|
||
It is the companion to the [focus-visible polyfill]. Note that this plugin | ||
alone **is not** sufficient to polyfill for `:focus-visible` and that you need | ||
the browser's polyfill as well. | ||
|
||
[](https://caniuse.com/#feat=css-focus-visible) | ||
|
||
```css | ||
|
||
```pcss | ||
<example.css> | ||
|
||
/* becomes */ | ||
|
||
<example.expect.css> | ||
``` | ||
|
||
[PostCSS Focus Visible] duplicates rules using the `:focus-visible` pseudo-class | ||
with a `.focus-visible` class selector, the same selector used by the | ||
[focus-visible polyfill]. | ||
|
||
<usage> | ||
|
||
<envSupport> | ||
|
||
## Options | ||
|
||
### preserve | ||
|
||
The `preserve` option determines whether the original notation | ||
is preserved. By default, it is not preserved. | ||
|
||
```js | ||
<exportName>({ preserve: true }) | ||
``` | ||
|
||
```pcss | ||
<example.css> | ||
|
||
/* becomes */ | ||
|
||
<example.preserve-true.expect.css> | ||
``` | ||
|
||
### replaceWith | ||
|
||
The `replaceWith` option defines the selector to replace `:focus-visible`. By | ||
default, the replacement selector is `.focus-visible`. | ||
|
||
```js | ||
<exportName>({ replaceWith: '[data-focus-visible-added]' }) | ||
``` | ||
|
||
```pcss | ||
<example.css> | ||
|
||
/* becomes */ | ||
|
||
<example.preserve-true.expect.css> | ||
``` | ||
|
||
Note that if you want to keep using [focus-visible polyfill], the only | ||
acceptable value would be `[data-focus-visible-added]`, | ||
given that the polyfill does not support arbitrary values. | ||
|
||
<linkList> | ||
[Selectors Level 4 specification]: <specUrl> | ||
[focus-visible polyfill]: https://github.com/WICG/focus-visible |
This file contains hidden or 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 |
---|---|---|
|
@@ -2,7 +2,17 @@ | |
"name": "postcss-focus-visible", | ||
"description": "Use the :focus-visible pseudo-selector in CSS", | ||
"version": "6.0.4", | ||
"author": "Jonathan Neal <[email protected]>", | ||
"contributors": [ | ||
{ | ||
"name": "Antonio Laguna", | ||
"email": "[email protected]", | ||
"url": "https://antonio.laguna.es" | ||
}, | ||
{ | ||
"name": "Romain Menke", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"license": "CC0-1.0", | ||
"funding": { | ||
"type": "opencollective", | ||
|
@@ -33,15 +43,19 @@ | |
"peerDependencies": { | ||
"postcss": "^8.2" | ||
}, | ||
"devDependencies": { | ||
"puppeteer": "^15.1.1" | ||
}, | ||
"scripts": { | ||
"build": "rollup -c ../../rollup/default.js", | ||
"clean": "node -e \"fs.rmSync('./dist', { recursive: true, force: true });\"", | ||
"docs": "node ../../.github/bin/generate-docs/install.mjs", | ||
"docs": "node ../../.github/bin/generate-docs/install.mjs && node ../../.github/bin/generate-docs/readme.mjs", | ||
"lint": "npm run lint:eslint && npm run lint:package-json", | ||
"lint:eslint": "eslint ./src --ext .js --ext .ts --ext .mjs --no-error-on-unmatched-pattern", | ||
"lint:package-json": "node ../../.github/bin/format-package-json.mjs", | ||
"prepublishOnly": "npm run clean && npm run build && npm run test", | ||
"test": "node .tape.mjs && npm run test:exports", | ||
"test:browser": "node ./test/_browser.mjs", | ||
"test:exports": "node ./test/_import.mjs && node ./test/_require.cjs", | ||
"test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs" | ||
}, | ||
|
@@ -80,8 +94,10 @@ | |
"trackpad" | ||
], | ||
"csstools": { | ||
"cssdbId": "focus-visible-pseudo-class", | ||
"exportName": "postcssFocusVisible", | ||
"humanReadableName": "PostCSS Focus Visible" | ||
"humanReadableName": "PostCSS Focus Visible", | ||
"specUrl": "https://www.w3.org/TR/selectors-4/#the-focus-visible-pseudo" | ||
}, | ||
"volta": { | ||
"extends": "../../package.json" | ||
|
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.
I realised this was a leftover which would have exported the wrong types, this hasn't been published yet so it's not a big concern