Skip to content

minification does not happen for gradients #306

@layershifter

Description

@layershifter

Versions

[email protected]

Problem

Stylis does minification and it works great:

.foo { color: red; }
.bar {
  color: blue;
  background: orange;
}
/* ⬇️⬇️⬇️ */
.foo{color:red;}.bar{color:blue;background:orange;}

The problem happens with radial-gradient& repeating-linear-gradient:

.foo {
  background: repeating-linear-gradient(
    -45deg,
    red,
    red 5px,
    blue 5px,
    blue 10px
  );
}
.bar {
  color: blue;
  background: orange;
}
.baz {
  background-image:radial-gradient(
    ellipse 50rem 50rem,
    #8e91e6 0%, 
    #403f5a 25%,
    transparent 46%
  )
}
/* ⬇️⬇️⬇️ */
 .foo{background:repeating-linear-gradient(
    -45deg,
    red,
    red 5px,
    blue 5px,
    blue 10px
  );}.bar{color:blue;background:orange;}.baz{background-image:radial-gradient(
    ellipse 50rem 50rem,
    #8e91e6 0%, 
    #403f5a 25%,
    transparent 46%
  );}

👆 notice that .foo & .baz are not minified.

Reproduction

https://codesandbox.io/s/awesome-rgb-wf0j3e

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