-
Notifications
You must be signed in to change notification settings - Fork 145
Closed as not planned
Labels
bugwontfixBug reports that maintainers have agreed by consensus are not bugs in the libraryBug reports that maintainers have agreed by consensus are not bugs in the library
Description
I'm using this parser in a project to optimize and pull data from hundreds of old CSS files, most of which make use of only hex and named colors.
CSS example:
.selector {
color: white;
background: red url('image.jpg') 50px 150px repeat-x;
border: 1px solid darkred;
}
After expandShorthands()
.selector {
color: white;
border-top-style: darkred;
border-right-style: darkred;
border-bottom-style: darkred;
border-left-style: darkred;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
background-color: transparent;
background-image: url("image.jpg");
background-repeat: repeat-x;
background-attachment: scroll;
background-position: 50px 150px;
}
If a selector has shorthand border or background properties that use color names, border colors become border-style values and background colors are dropped entirely and replaced with "transparent".
My current workaround for this is to use a custom class to parse the value strings and convert any color names to hex values before running expandShorthands()
.
Metadata
Metadata
Assignees
Labels
bugwontfixBug reports that maintainers have agreed by consensus are not bugs in the libraryBug reports that maintainers have agreed by consensus are not bugs in the library