Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Neccessary quotes are removed from CSS Grid Areas syntax #917

Closed
joestrong opened this issue Mar 15, 2017 · 2 comments
Closed

Neccessary quotes are removed from CSS Grid Areas syntax #917

joestrong opened this issue Mar 15, 2017 · 2 comments
Labels
Milestone

Comments

@joestrong
Copy link

I'm using the new CSS Grid Layout syntax (now in stable chrome & firefox), and part of it doesn't run well through CSS Clean.

I'm using clean-css-cli v4.0.9 with default options on arch linux

When processing this code:

.grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  grid-template-rows: 150px auto;
  grid-template-areas: "header header" "nav body";
}

@media (max-width: 640px) {
    .grid {
      grid-template-columns: 1fr;
      grid-template-rows: 150px auto;
      grid-template-areas: "header" "nav" "body";
  }
}

I get this output:

.grid{display:grid;flex:1;max-width:1024px;grid-template-columns:1fr 2fr;grid-template-rows:150px auto;grid-template-areas:"header header" "nav body"}@media (max-width:640px){.grid{grid-template-columns:1fr;grid-template-rows:150px auto;grid-template-areas:header nav body}}.

The important part being:

grid-template-areas:"header header" "nav body"

grid-template-areas:header nav body

Where multiple words are used in quotes for grid-template-areas, the quotes remain, however with single words in quotes, the quote marks are stripped and this causes the CSS property's value to be invalid (quotes are required as they define rows in the CSS Grid).

W3C Docs: https://www.w3.org/TR/css3-grid-layout/#grid-template-areas-property

@jakubpawlowicz
Copy link
Collaborator

You are totally right, fix is coming!

@jakubpawlowicz jakubpawlowicz modified the milestone: 4.0.10 Mar 20, 2017
jakubpawlowicz added a commit that referenced this issue Mar 20, 2017
Why:

* Specification requires such values to be quoted so should the values
  be preserved.
jakubpawlowicz added a commit that referenced this issue Mar 20, 2017
Why:

* Specification requires such values to be quoted so should the values
  be preserved.
@jakubpawlowicz
Copy link
Collaborator

It's fixed in 4.0.10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants