Skip to content

Question: How to use grid-template-areas? #181

Answered by layershifter
kollster asked this question in Q&A
Discussion options

You must be logged in to vote

@kollster grid-template-areas is not a shorthand property, so you can pass it as it. While grid-area is a shorthand property we have a function for it in the latest release.

I transformed your snippet into the code below:

const useClasses = makeStyles({
  layout: {
    display: "grid",
    gridTemplateAreas: `
    "header header"
    "nav    main  "
    "footer footer"
    `
  },
  header: {
    ...shorthands.gridArea("header")
  }
});

https://codesandbox.io/s/boring-fast-3zfsdg?file=/src/App.tsx


Please let us know if you need additional help 🐱

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by layershifter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #179 on August 02, 2022 11:22.