csso icon indicating copy to clipboard operation
csso copied to clipboard

merge CSS parameters with their shorthands

Open djibe opened this issue 6 years ago • 2 comments

Hi, will CSSO be able to merge CSS declarations with Shorthand properties ? Ex from Google CSS styling guide

/* Input */
border-top-style: none;
font-family: palatino, georgia, serif;
font-size: 100%;
line-height: 1.6;
padding-bottom: 2em;
padding-left: 1em;
padding-right: 1em;
padding-top: 0;
/* Output (expected) */
border-top: 0;
font: 100%/1.6 palatino, georgia, serif;
padding: 0 1em 2em;

djibe avatar Jan 03 '19 21:01 djibe

CSSO does it best to make such transformations. However, this optimisation works for limited list of shorthands, i.e. padding and margin is supported, but font is not. Current output (CSSO 4.0.2):

    border-top-style: none;
    font-family: palatino,georgia,serif;
    font-size: 100%;
    line-height: 1.6;
    padding: 0 1em 2em

lahmatiy avatar Dec 06 '19 13:12 lahmatiy

Thanks. Great job

djibe avatar Dec 06 '19 17:12 djibe