postcss-focus-within
Advanced tools
Comparing version 6.0.0 to 6.1.0
# Changes to PostCSS Focus Within | ||
### 6.1.0 (July 30, 2022) | ||
- Added: `disablePolyfillReadyClass` plugin option to prevent `.js-focus-within` from being added. | ||
### 6.0.0 (July 8, 2022) | ||
@@ -4,0 +8,0 @@ |
@@ -5,4 +5,5 @@ import type { PluginCreator } from 'postcss'; | ||
replaceWith?: string; | ||
disablePolyfillReadyClass?: boolean; | ||
}; | ||
declare const creator: PluginCreator<pluginOptions>; | ||
export default creator; |
{ | ||
"name": "postcss-focus-within", | ||
"description": "Use the :focus-within pseudo-selector in CSS", | ||
"version": "6.0.0", | ||
"version": "6.1.0", | ||
"contributors": [ | ||
@@ -6,0 +6,0 @@ { |
@@ -107,2 +107,29 @@ # PostCSS Focus Within [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">][postcss] | ||
### disablePolyfillReadyClass | ||
The `disablePolyfillReadyClass` option determines if selectors are prefixed with an indicator class. | ||
This class is only set on your document if the polyfill loads and is needed. | ||
By default this option is `false`. | ||
Set this to `true` to prevent the class from being added. | ||
```js | ||
postcssFocusWithin({ disablePolyfillReadyClass: true }) | ||
``` | ||
```pcss | ||
.my-form-field:focus-within label { | ||
background-color: yellow; | ||
} | ||
/* becomes */ | ||
.my-form-field[focus-within] label, .my-form-field[focus-within] label { | ||
background-color: yellow; | ||
} | ||
.my-form-field:focus-within label { | ||
background-color: yellow; | ||
} | ||
``` | ||
## Browser | ||
@@ -120,3 +147,3 @@ | ||
<!-- When using a CDN url you will have to manually update the version number --> | ||
<script src="https://unpkg.com/postcss-focus-within@5.0.4/dist/browser-global.js"></script> | ||
<script src="https://unpkg.com/postcss-focus-within@6.1.0/dist/browser-global.js"></script> | ||
<script>focusWithinInit()</script> | ||
@@ -123,0 +150,0 @@ ``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
39825
41
187