Skip to content

calc() optimization #11

@tomhodgins

Description

@tomhodgins
div {
  background : lime ;
  width : calc(50% + (5em + 5%)) ;
  height : calc(50% + (5em + 5%)) ;
}

correct minification

div{background:lime;width:calc(55% + 5em);height:calc(55% + 5em)}
  • even without evaluating it, the formula can be consolidated further

CSSnano output

div{background:lime;width:calc(50% + (5em + 5%));height:calc(50% + (5em + 5%))}
  • the 50% and 5% can be added together

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions