Question: How to use grid-template-areas? #181
-
I can't quite figure out how to use I am trying to make the equivalent of something like this css: .layout {
display: grid;
grid-template-areas:
"header header"
"nav main "
"footer footer";
}
.header {
grid-area: header;
} Any help on how to do this will be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@kollster grid-template-areas is not a shorthand property, so you can pass it as it. While 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 🐱 |
Beta Was this translation helpful? Give feedback.
@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:
https://codesandbox.io/s/boring-fast-3zfsdg?file=/src/App.tsx
Please let us know if you need additional help 🐱