[wp-trac] [WordPress Trac] #50627: CSS Build process: Consider removing autoprefixer from the source folder.
WordPress Trac
noreply at wordpress.org
Fri Jul 10 19:07:15 UTC 2020
#50627: CSS Build process: Consider removing autoprefixer from the source folder.
------------------------------+-----------------------------
Reporter: youknowriad | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Build/Test Tools | Version:
Severity: normal | Keywords:
Focuses: css |
------------------------------+-----------------------------
Right now, the CSS build process is a bit unclear to me. It seems like
there's a precommit hook to apply postcss autoprefixer to the CSS fils in
src folder. This results in "source code" and "built code" to be mixed
together.
The issue becomes more apparent as we explore using new techologies list
CSS custom properties. If we continue with the current setup it means we'd
have to include in the source code both the CSS variables used, and the
necessary fallback for IE11 (as CSS variables are not supported there). So
whenever we want to change the value of the CSS variable, we'd have to
update all the fallback values, diminishing the value of the CSS variable
in the first place.
Autoprefixer and CSS Custom properties are the examples I have in mind
right now, but this can be problematic for any similar CSS feature we'd be
interested in.
I think we should consider only applying the PostCSS tweaks (autoprefixer)
to the build folder only. The downside is that the source "css" files
won't have the necessary fallbacks for legacy browsers but they will still
continue to work in most recent browsers.
In an ideal world, source and dist are completely different but it's too
soon for that as a lot of core developers still use the "src" folder.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/50627>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list