sdras / cssgridgenerator

🧮 Generate basic CSS Grid code to make dynamic layouts!
https://cssgrid-generator.netlify.com/
MIT License
5.04k stars 551 forks source link

braces for the first css selectors #75

Closed RolandNaijuka closed 5 years ago

RolandNaijuka commented 5 years ago

The braces for the first selector in the created CSS code creates the closing braces at the end of the file instead of closing that first selector

pnevares commented 5 years ago

I had noticed this but immediately recognized it as Sass/Less-style nested selectors. But I also understand that it's not accessible to anybody unfamiliar with those tools. Intentional or not I agree that this behavior should change.

wlvstv commented 5 years ago

@RolandNaijuka / @pnevares is the issue that you are seeing the div classes nested within the parent like so?

.parent {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  grid-column-gap: 0px;
  grid-row-gap: 0px;
  .div1 { grid-area: 1 / 1 / 4 / 5; }
  .div2 { grid-area: 2 / 5 / 3 / 6; }
  .div3 { grid-area: 2 / 5 / 4 / 6; }
} 

are you preferring to see a closed parent with subsequent div line items? like this:

.parent {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  grid-column-gap: 0px;
  grid-row-gap: 0px;
}
.div1 { grid-area: 1 / 1 / 4 / 5; }
.div2 { grid-area: 2 / 5 / 3 / 6; }
.div3 { grid-area: 2 / 5 / 4 / 6; }
sdras commented 5 years ago

Correct, this is SCSS syntax. If you've never tried it, you should check it out. Updated.