Relatively Simple CSS Grid question

I want the specific grid-area hero created with grid-template areas to have a fixed size no matter if it sits left or right of the heading. I have found a solution but I feel like there must be a better way to responsibly manage this. I provided screenshots of the issue and the code I used cause I think for an expert this is a rather simple question. I'll create a codepen if it's required.
4 Replies
Kevin Powell
Kevin Powell13mo ago
The grid template makes sense to me. I guess the question mostly revolves around the auto v.$hero-size and having to change that for both of them. The other thing I can think of is to use the v.$hero-size as the width of the .round-hero instead... at least without seeing more anyway. That might not work either, but it's the first thing I'd try.
Joao
Joao13mo ago
I'm also wondering the same. It seems that using auto when specifying the column width cannot be easily overwritten, even when specifying the width using !important...
Mira 🏳⚧
Mira 🏳⚧13mo ago
I have infact put the
css v.$hero-size
css v.$hero-size
as the width of
css round-hero
css round-hero
but it defaults to the 50 / 50 layout. My idea was that there might be a way to do something like this pseudocode
css grid-area-width: value
css grid-area-width: value
that would set the the grid-width of the
css grid-area: hero
css grid-area: hero
to said value no matter where it is positioned. But since this is a niche use case I don't think it exists. In anyway thanks a lot for your content kevin. I learn a lot from your videos/shorts even those
css .round-hero
css .round-hero
was heavily inspired by you :) Oh sorry I messed up there, I was supposed to inline-tag that Important follow up question, how do I tag this as solved on the phone?
Jochem
Jochem13mo ago
In the channel list to the left, hold on the topic name and click edit tags