An Interest In:
Web News this Week
- April 20, 2024
- April 19, 2024
- April 18, 2024
- April 17, 2024
- April 16, 2024
- April 15, 2024
- April 14, 2024
Reduce Duplicated Styled Components? Check Here
I made a post 2 weeks ago about how to reduce CSS automatically: Scan Duplicated & Similar CSS and the github source: css-checker
Few days ago, there was an issue asking for styled components support. It's very hard to found few sources about processing styled components using golang, so I have to use regex to detect them and use original css-checker functions to detect diffs in styled-components.
Fortunately, it goes well to use css-checker for styled-components checking and you can use this now for styled-components check. It can check similar lines and prints those blocks with diff lines highlighted.
Install
- You can access to the package via
go install
:
go install github.com/ruilisi/css-checker@latest
(With go version before 1.17, use go get github.com/ruilisi/css-checker). Or download from releases
- Or from npm:
npm install -g css-checker-kit
Start Checking
cd
to yourProject Path
. Then just run:
css-checker -styled
- If only need to check styled-components:
css-checker -css=false -styled
For other usages, please refer to github: CSS-Checker
Demo
Original Link: https://dev.to/zhcalvin/reduce-duplicated-styled-components-check-here-240p
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To