question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[jss-expand] Add optional syntax for CSS grids templateAreas

See original GitHub issue

CSS grid template areas’ ascii-layout is “special” and would probably benefit from being documented.

The best way I’ve come up with to get it working involves back-tick and single quotes.

 templateAreas: `
             'head    head    head'
             'left    panel   right'
             'foot    foot    foot'`

An alternative that might be supported (and might lend itself to better dynamics) is using an array syntax:

 templateAreas: [
             'head    head    head',
             'left    panel   right',
             'foot    foot    foot']
  • document current syntax
  • add a nicer syntax to jss-expand

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
HenriBeckcommented, Feb 10, 2019

No, there is just no better syntax than this yet:

 templateAreas: `
             'head    head    head'
             'left    panel   right'
             'foot    foot    foot'`
0reactions
GalGreenfieldcommented, Feb 10, 2019

No, not yet.

Okay, thanks for the information.

I’m new to React. If I were to want to use template-areas with a JSS component, I’d have to use it its style prop, right? Just making sure I know a workaround until this is implemented.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Grid template areas - CSS: Cascading Style Sheets | MDN
When you use CSS Grid Layout you always have lines, and this can be a ... This method involves placing our items using...
Read more >
grid-template-areas | CSS-Tricks
The grid-template-areas CSS property allows you to define and name the cells (or “areas”) in a CSS grid container.
Read more >
Understanding CSS Grid: Grid Template Areas
The grid-template-areas property accepts one or more strings as a value. Each string (enclosed in quotes) represents a row of your grid. You...
Read more >
CSS grid-template-areas Property - W3docs
Yes. Items are animatable. Version, CSS Grid Layout Module Level 1. DOM Syntax, object.style.gridTemplateAreas = ''item1 item1 . .
Read more >
CSS grid-template-areas property - W3Schools
Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, PHP, Python,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found