canonical / canonical/vanilla-framework
Decide on vendor prefix strategy and clean up the code
- Dominant language
- HTML
- Stars
- 983
- Forks
- 216
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 3
Description
Follow up to Stylelint migration #3010
In Vanilla codebase we have quite a lot of places where we explicitly add vendor prefixes to some properties. Mostly they come from this PR #2176 that was an attempt to make Vanilla independent of autoprefixer for sites that don't use it.
At the same time we actively disallow usage of vendor prefixes with linting. (both previous sass-lint and current stylelint), so all these places where we add prefixes need to disable linting.
Additionally we do have autoprefixer in build pipeline, so Vanilla itself doesn't need prefixes in the code. Autoprefixer seems to be adding some on it's own, so apparently there are prefixes that are not hardcoded in Vanilla that are needed.
We should decide on consistent vendor prefix strategy and implement it.
### Option 1: Use autoprefixer
Autoprefixer should be the only source of vendor prefixes (unless it doesn't support given property).
This will let us keep Vanilla code clean and allow us to not worry if given property should be prefixed or not. Autoprefixer has the best knowledge of what properties need prefixes and is fully automated.
We will not have to maintain prefixes manually, we will not have to remember to add them, we will not have to remove them when we don't need them anymore.
### Option 2: Only hardcoded vendor prefixes
We should have full control over which properties are prefixed. We should remove autoprefixer and only prefix properties that we need to be prefixed. Possibly many of properties that are currently prefixed in Vanilla code doesn't need to anymore (-webkit-transition -webkit-animation) unless we aim to support really old browser versions.
We should adapt our linting to that strategy. Try to enforce prefixing some particular properties, or fail test when property is not prefixed, etc.
This will allow us to have full control over prefixes and will make Vanilla independent from autoprefixer. But it will leave the maintenance cost on Vanilla developers.
Contributor guide
Research direction
Start by reviewing the linked context in issues #3010 and #2176, then inspect the build pipeline and linting configuration to understand the current vendor-prefix sources. Done means choosing one strategy, applying it consistently across the codebase, and updating the related build or linting setup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css
- Domain
- build-system, frontend, tooling
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100