Skip to content

Commit a0ed51e

Browse files
authored
Merge pull request #577 from Automattic/remove-inlined-selectors
feat: remove inlined selectors
2 parents 62f8d7b + 2467f72 commit a0ed51e

5 files changed

Lines changed: 684 additions & 436 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ All Juice methods take an options object that can contain any of these propertie
5555
| `preserveMediaQueries` | `true` | Preserve all media queries (and contained styles) within `<style>` tags as a refinement when `removeStyleTags` is `true`. Other styles are removed. |
5656
| `preserveKeyFrames` | `true` | Preserve all key frames within `<style>` tags as a refinement when `removeStyleTags` is `true`. Other styles are removed. |
5757
| `preservePseudos` | `true` | Preserve all rules containing pseudo selectors defined in `ignoredPseudos` within `<style>` tags as a refinement when `removeStyleTags` is `true`. Other styles are removed. |
58-
| `removeStyleTags` | `true` | Remove the original `<style>` tags after (possibly) inlining their CSS content. |
58+
| `removeInlinedSelectors` | `false` | Remove CSS rules from `<style>` tags after (possibly) inlining them. Other rules are preserved. Works only if `removeStyleTags` is `false`. |
59+
| `removeStyleTags` | `true` | Remove the original `<style>` tags after (possibly) inlining their CSS content. Overrides `removeInlinedSelectors`. |
5960
| `resolveCSSVariables` | `true` | Resolve CSS variables. |
6061
| `webResources` | `{}` | An options object that will be passed to [web-resource-inliner](https://www.npmjs.com/package/web-resource-inliner) for Juice functions that will get remote resources (`juiceResources` and `juiceFile`). |
6162
| `xmlMode` | `false` | Output XML/XHTML with all tags closed. Note that the input *must* also be valid XML/XHTML or you will get undesirable results. |

juice.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ declare namespace juice {
3737
extraCss?: string;
3838
applyStyleTags?: boolean;
3939
removeStyleTags?: boolean;
40+
removeInlinedSelectors?: boolean;
4041
preserveMediaQueries?: boolean;
4142
preserveFontFaces?: boolean;
4243
preserveKeyFrames?: boolean;

0 commit comments

Comments
 (0)