#52158 closed defect (bug) (fixed)
Twenty Twenty-One: Clean up CSS build process
Reported by: | ryelle | Owned by: | ryelle |
---|---|---|---|
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.
4 years ago
#1
- Keywords has-patch added
carolinan commented on PR #835:
4 years ago
#4
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.
carolinan commented on PR #835:
4 years ago
#5
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.
4 years ago
#6
I dropped the change around .css.map
files. These were intentionally ignored in r49576 - if we want to bring them back, we should un-ignore them in SVN and add the files, which should be done in a new ticket.
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