GithubHelp home page GithubHelp logo

Comments (3)

ZombieChowder11 avatar ZombieChowder11 commented on May 25, 2024 1

Hey @kettanaito , that does solve the problem, thanks!

from atomic-layout.

kettanaito avatar kettanaito commented on May 25, 2024

Hey, @ZombieChowder11. Thanks for asking this, I'll try to help.

First that catches my attention is that in your templateTablet string you have unequal number of areas and columns:

meta actions mex
text hex
/ auto auto auto auto

By specifying 4 columns (/auto auto auto auto) you need to make sure that your areas (meta, actions, text, hex) fill all those columns. This requirement comes from the CSS Grid spec, and the proper template may look like this:

meta actions mex .
text hex . .
/ auto auto auto auto

I've used a dot (.) as a placeholder area in the grid. This means that the associated row/column will not be taken by any areas.

However, from what you've described, using a placeholder isn't what you want. I believe the layout you want can be achieved by repeating the areas you wish to span between columns:

meta meta actions mex
text text text hex

In the template above the meta area takes 1 / span 3 columns, leaving actions and mex to follow in the 3rd and 4th columns respectively. The text area on the second row takes 1 / span 4 columns, with hex following in the remaining column.

Repeating an area in a grid-template-areas is an implicit way to specify its grid-column-start and grid-column-end (as well as similar properties for grid-row-*). This way you don't have to specify start/end explicitly, as well as auto auto ... for each column.

Here's a sandbox with the solution using the areas from the explanation above.

In case I didn't get the position properly, try to play around with the areas repetition, I'm sure you'll get it as you need. Let me know if this answers your question.

from atomic-layout.

kettanaito avatar kettanaito commented on May 25, 2024

Happy to hear that!

from atomic-layout.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.