#52158 closed defect (bug) (fixed)
Twenty Twenty-One: Clean up CSS build process
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 5.7 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Bundled Theme | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
The current Sass + PostCSS build process generates redundant code. The Sass step generates source map files we don't use, and the PostCSS step generates some duplicate code in ie.css
& ie-editor.css
. The PostCSS issue is a bug upstream, but we can work around it with postcss-discard-duplicates.
Change History (10)
This ticket was mentioned in PR #835 on WordPress/wordpress-develop by ryelle.
2 months ago
- Keywords has-patch added
#4
@
8 weeks ago
carolinan commented on PR #835:
There has been several requests to keep the map files. So much that Theme Check has been updated to allow .map files again. Twenty Nineteen also has a .map file so I think it should be included in the commit.
#5
@
8 weeks ago
carolinan commented on PR #835:
I have now tested the PR with and without https://github.com/WordPress/wordpress-develop/pull/806
and except for keeping the .map file it works well and solves the problem that prevented us from committing 806.
This adds `postcss-discard-duplicates` to the PostCSS step to clean up the IE styles. All the CSS that is removed shows up again later in the file (in the case of, ex,
blockquote cite
). The duplicate media queries are due to a bug in postcss-css-variables.Also, this has disabled source map generation in the sass, since these files are not to be committed. I'm open to leaving this out & instead adding
*.map
to gitignore - my main issue has been that they show up in my git changesets.Trac ticket: https://core.trac.wordpress.org/ticket/52158#ticket