sebastiaanvisser / clay

A CSS preprocessor as embedded Haskell.
Other
360 stars 73 forks source link

Add size constants and properties for grid areas #193

Closed NCrashed closed 4 years ago

NCrashed commented 5 years ago

Hi, I hit missing properties for sizes and grid areas and added them into my project. So, that it is draft for possible additions. I am not sure if experimental CSS API is acceptable in clay. Also, more consistent part of grid areas API should be added to the PR.

Use case:

.grid1 {
  display: grid;
  width: max-content;
}

.grid3 {
  display: grid;
  width: max-content;
}

@media (min-width: 40.0rem) {
  .grid3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-gap: 1rem;
    width: max-content;
  }
}
  ".grid1" ? do
    display grid
    width maxContent
  ".grid3" ? do
    display grid
    width maxContent
  query M.screen [M.minWidth (rem 40)] $ ".grid3" ? do
    display grid
    gridTemplateColumns [fr 1, fr 1, fr 1]
    gridGap $ rem 1
    width maxContent
turion commented 5 years ago

I think it's a good idea to add your usage example to the module docs of your new Clay.Grid module.

NCrashed commented 4 years ago

Thanks for your contribution! I don't understand the CSS aspects well enough to judge this, so ideally you could ping someone who does, for a short review. (If you don't know anyone, no worries.)

Your PR is marked as a draft. What's missing?

Unfortunately, I don't know such experts to call them :). I marked the PR as draft as I feel it doesn't cover all related API for grid areas. So, if it is enough to be merged lets cover the rest of API in subsequent PRs.

turion commented 4 years ago

Unfortunately, I don't know such experts to call them :)

No worries. I think this PR is good, we can merge it. If you want you can open separate issues that explain what should be added to the API to complete it.

turion commented 4 years ago

Thanks!