A new approach to container and wrapper classes

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 พ.ย. 2024

ความคิดเห็น • 632

  • @42pe
    @42pe 9 หลายเดือนก่อน +85

    I’ve been working in web dev for 20+ years, and this is one of the few times I’ve seen someone come up with an alternative to such a huge industry standard and actually offer a simpler, viable one. Kudos to you!

  • @bryandenijs7661
    @bryandenijs7661 ปีที่แล้ว +249

    A while ago I had exactly this requirement to solve. Ended up with a lot of container elements and I hated it, but didn't know a better solution. This would have really helped me. I really like it and I don't think it is over-engineered at all. I think it's a very clean way without al those wrapper/container elements. Thanks for the inspiration!

    • @ZimmervisionCZ
      @ZimmervisionCZ ปีที่แล้ว +19

      Yeah I definitely prefer this over wrappers or containers, especially because I'm a bit opinionated that markup should be content. In my opinion, a wrapper div is a form of coupling between markup and style that is best avoided.

    • @MayhemPhone
      @MayhemPhone ปีที่แล้ว +9

      Agreed. The hours, and hours of refactoring I’ve had to do when suddenly a designer adds a breakout element… my god.
      I would need to use this for a full project, and see how it holds up… but my gut says this is a really elegant solution to an often messy problem.

    • @jcsilverx
      @jcsilverx ปีที่แล้ว +3

      x2. It was already somewhat tedious, but this... solves the problem. =')

    • @t3hpwninat0r
      @t3hpwninat0r 11 หลายเดือนก่อน +1

      print designers do this stuff all the time. so annoying for us web developers to code, but not any more!

  • @simonced
    @simonced ปีที่แล้ว +20

    It is a complex solution, but it's the kind of solution you do once, then you can forget about it.
    That outweighs the complexity, and will improve clarity in the HTML, which is usually where it can get really messy.
    What a great solution, I'll try something like that in my next project, thanks for the idea!

    • @Dead_Goat
      @Dead_Goat 9 หลายเดือนก่อน

      containers are for more clear than this...

    • @feba33
      @feba33 6 หลายเดือนก่อน +1

      @@Dead_Goat you’re crazy

      Is far easier than 20 nested divs

  • @BlackistedGod
    @BlackistedGod ปีที่แล้ว +78

    damn, I have been working with HTML/CSS for more than a decade and been looking for a solution like this.
    I'm the type of guy who wants to keep HTML structure as simple and short as possible.

    • @FreeScience
      @FreeScience 9 หลายเดือนก่อน +2

      To be fair we haven't had grid (or flex-box) for that long :)

  • @dom8429
    @dom8429 ปีที่แล้ว +61

    html structure should be as simple as possible (because it's what get's updated most). if that means we move the complexity into a long line of css that's an excellent trade-off!
    you always have complexity, the question is just *where* you put it. of course in some cases it makes more sense to have a quick max-width container instead of a robust and flexible solution like this. but it's really good to know this and be able to choose. thanks so much

    • @Novacification
      @Novacification 9 หลายเดือนก่อน +1

      This is one of the things that easily gets difficult with something like react. Component structure, especially when using component libraries, often adds a lot of DIVs to the DOM structure. You can avoid it nowadays but many developers who "grew up" with react don't give it much thought and add DIVs instead of fragments etc.
      It's also frustratingly common for people to leave DIVs around with conditional renders because they only wrap the DIV content in the condition, not the containing DIV itself.

  • @tanglesites
    @tanglesites 16 วันที่ผ่านมา

    Genius! I love the comment about, its not about the ease of implementation its about the ease of re-use. That sums up software development in a nutshell.

  • @VilleTakanen
    @VilleTakanen ปีที่แล้ว +25

    As a person who also occasionally does paper layouts - I love this. It's a very analog approach to page grid ❤

  • @TheCebulon
    @TheCebulon หลายเดือนก่อน +1

    So, you discovered, how to structure a page layout of magazines and newspapers.
    Something I forgot for a long time.
    I love it.
    Finally a good approach to (web) layout. Thank you for introducing us to this.

  • @bumbleguppy
    @bumbleguppy ปีที่แล้ว +64

    I started out in the XHTML era and the disciplined notion of a hard separation of the semantic html and style makes this nostalgically appealing. I can't see how this wouldn't be better for accessibility.

    • @forbiddenera
      @forbiddenera ปีที่แล้ว

      xHTML is alive and well and thus makes me cringe to see single quoted attributes. Also, container/wrapper divs aren't helpful for accessibility per se but you can make them ignored.

    • @isaacpriestley
      @isaacpriestley 8 หลายเดือนก่อน

      I thought XHTML was gonna be the coolest thing in 2005. I loved the idea of really pure HTML.

  • @NathanChase
    @NathanChase ปีที่แล้ว +2

    I really like this, and my mind immediately jumps to setting a 'container-type: inline-size' on the 'main', and then setting padding and max-widths as units of cqw, rather than rems or ch units. Then you can set a single width for the whole container and everything underneath will automatically, perfectly scale.
    --padding-inline: 10cqw;
    --content-max-width: 50cqw;
    --breakout-max-width: 60cqw;
    container-type: inline-size;

  • @zeddash
    @zeddash ปีที่แล้ว +25

    What I love about web development is that there's always something to learn and each challenge is a puzzle. Never thought to use grid for this but as soon as you showed you were using grid I knew where this was going.
    This is a far better solution than using wrappers.

  • @UandUs-RicLeP
    @UandUs-RicLeP 9 หลายเดือนก่อน +1

    I’ve been using something very similar to this in a few projects for a while now and it’s great. Once you’ve set it up it’s a game changer.
    Couple of additions with the named tracks:
    You can span from one name to another, i.e. you could go from breakout-start to full-width-end - really handy for off-centre content, particularly if you add more tracks or have one for the very centre of the screen - you can then span from the edge to the middle. Works beautifully with sub-grid.
    You can add multiple names to a grid like [content-start break-outstart]. Why would you want to do this? When you want more control with breakpoints and scaling. On mobile you might have two tracks share the same size but on desktop you then create two different tracks like in the video. That might seem pointless as it’s responsive already, but if you want fine grain control, such as not liking when the breakout is only 20 pixels wider than the content, and want it to only break out when it’s 100 pixels wider for instance you can.
    There is so much scope with this technique, and using subgrid, or inheriting lets you simply align elements in different containers.

  • @easyluckable
    @easyluckable 4 หลายเดือนก่อน +1

    This video makes me realize I view grid like a table, rather than a powerful layout tool with different possibilities

  • @SickOfMetal
    @SickOfMetal 4 หลายเดือนก่อน +12

    absolutely power house move! this is how i "organized" the grid-template-columns. you may recognize its got a familiar look to html tags but it works for me.
    grid-template-columns:
    [full-width-start]
    minmax(var(--padding-inline), 1fr)
    [breakout-start]
    minmax(0, var(--breakout-size))
    [content-start]
    min(100% - (var(--padding-inline) * 2), var(--content-max-width))
    [content-end]
    minmax(0, var(--breakout-size))
    [breakout-end]
    minmax(var(--padding-inline), 1fr)
    [full-width-end];

  • @JoseMVelazquez
    @JoseMVelazquez ปีที่แล้ว +2

    Anything that reduces the excesive use of container divs we see these days is a welcome change for me.

  • @VeitLehmann
    @VeitLehmann ปีที่แล้ว +36

    This is really neat! Until now, I only used named grid areas or no names at all. I didn't know that you could create nested named grid areas via named start/end grid lines. Thanks for the great demo, I love it! Easy to understand CSS, really easy to apply and work with in HTML, and every removed wrapper div is a good thing!

  • @LukeDorny
    @LukeDorny ปีที่แล้ว

    Love the ability to have an article tag span across several “sections” without having to close them. Also improves our ability to keep the markup semantic.

    • @LukeDorny
      @LukeDorny 9 หลายเดือนก่อน

      Now show us the subgrid version?

  • @denns0r
    @denns0r ปีที่แล้ว +1

    This approach does work for `display: flex` as well. The only thing that changes is that instead of using `.container` as a selector we're using `.full-width > :not(.breakout)` .. so basically this solution is not only working for grid. But there are disadvantages when using this: The more specific you get when using css selectors, the harder it gets when there is something to override. So it is very important to declare styles wisely that are bound specifically to your usecase. As soon as you start adding unrelated styles like font-family or so, you will end up in a mess of selectors.
    I find nothing wrong about that, but it has to be used wisely. 😃

  • @anthonybradshaw5155
    @anthonybradshaw5155 ปีที่แล้ว +1

    Just did this on a blog I recently built and it's made development so much more hassle-free.
    The blog uses a CMS with pre-defined, custom-built components, and instead of adding wrappers to every 'text block' component, we just have one div that wraps the whole article - each text block simply pumps out HTML directly from the text editor. At the same time, we can create fancy new full-width components & mini-apps and drop them in middle of an article. It works great.

  • @cubbucca
    @cubbucca ปีที่แล้ว +1

    love how this covers every screen size without the need for @media

  • @MayhemPhone
    @MayhemPhone ปีที่แล้ว

    Imo, it moves all the complicated bits into one spot, and massively simplifies everything else that is implemented. if I joined a project where all I had to do was add a breakout class on something, I’d sob with joy.
    Bravo.

  • @RuneScapeZammy
    @RuneScapeZammy ปีที่แล้ว +13

    This fits exactly the kind of "exception" to over-engineering you defined in your talk at CSS Cafe, which I very much agree to. I can imagine this to be made even easier and more versatile with a postcss function or SASS mixin/function. The biggest benefit, besides wrapping, that I see, is to make it even easier to work with CMS content. You will just be able to use a class or even just define grid areas for certain content types and elements.

  • @Akshatgiri
    @Akshatgiri ปีที่แล้ว

    Love it. This finally allows us to keep our html only to the markup that actually contains the content instead of having to create unnecessary boxes just for a simple layout.

  • @kobi-kobsen
    @kobi-kobsen ปีที่แล้ว +3

    There is really nothing wrong with containers, but this is just so much nicer. I still did not use grid, but as I watch your video I start changing my own little framework now. Thank you!

  • @AdventuresOfBillAndMia
    @AdventuresOfBillAndMia 28 วันที่ผ่านมา

    Just started watching your videos and I am loving your depth of knowledge and the simplicity of your explanations. For a frontend newbie like me, it is quite helpful. Thank you so much!... I have an inquiry and hopefully it is not too silly. I am looking to see how I can place a border (using a class) around a section that is wrapped in a div. It has me jammed up after researching and watching videos for a few days now. Lol! Anybody? Everybody? Help! Laughing and crying. Lol!😆

  • @AmyDePalma
    @AmyDePalma ปีที่แล้ว +5

    Really love this idea. So simple yet flexible. I'm working on a super-lightweight, non-framework-based set up for my company's sites and am super excited to play around with this! Thanks for taking your time.

  • @doug7897
    @doug7897 ปีที่แล้ว +38

    Main thing I like about this over auto-margins is you can use justify-items to keep inline-block/fixed-width items aligned to the left/right of the content bounds, rather than stuck centered without a dummy wrapper.

  • @janemig
    @janemig ปีที่แล้ว

    Being someone who is comfortable using containers/wrappers where needed, this seems like a cool new way to center your main content. I'll try it out and circle back! Thank you as always!

  • @alexandersanchez9138
    @alexandersanchez9138 หลายเดือนก่อน

    This is fantastic. Bravo, and kudos to the blog posters, too.

  • @pythagoran
    @pythagoran ปีที่แล้ว

    man, several of your recent videos made me stop and have to update my existing projects because the advice and benefits are so extraordinary!
    i no longer need to keep up to date with recent front end developments when i can just watch this guru right here :)

  • @omgnowairly
    @omgnowairly ปีที่แล้ว +10

    This is pure gold.
    For markdown formatting or user submitted content, this allows a new level of presentation.

  • @ssygon2
    @ssygon2 ปีที่แล้ว

    What a great solution!
    Beats trying to break out of the container using other ways which still 'not quite spans full width', all the way to the right side scroller:
    .full-width {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    }
    Your solution is way better than the above code!
    Even the following still feels hacky, and has some limitations:
    .full-bleed {
    box-shadow: 0 0 0 100vmax blue;
    clip-path: inset(0 -100vmax);
    }

  • @davi48596
    @davi48596 4 หลายเดือนก่อน +1

    This is exactly what I needed Kevin, you are my CSS god 🙏

  • @Adlore
    @Adlore ปีที่แล้ว

    I love this solution. I've never used much of grid, but the abiliy to remove a bunch of wrapper divs seems great, and it solves a pet peeves of mine. The cleanliness of the html is a nice result

  • @boby4751
    @boby4751 11 หลายเดือนก่อน

    I agree that is looks like a mess and complicated, but, I understand how versatile the code is, like you said, you change a few things and it just works without having to code multiple lines for every change that is being made. I love your videos, they are simple to understand and to the point.

  • @aje9633
    @aje9633 ปีที่แล้ว

    this one is a lifesaver.!!! Literally, it got my mind blown that this could be possible.

  • @mintcar
    @mintcar ปีที่แล้ว

    This is the most useful CSS trick I've found in years

  • @thomasw.enderle6565
    @thomasw.enderle6565 ปีที่แล้ว

    Love this. No need to play around with negative margins and stuff to breakout of a container. I think this makes so much sense!

  • @melissafrasik9272
    @melissafrasik9272 ปีที่แล้ว

    I am absolutely FLOORED by this method! I've been working through a project that implemented the full color background sections, much like your above example, but the number of wrapper divs required have been frustrating me endlessly. Although I've been using grid for years, I never realized you could name lines like this! This is such a beautiful, clean implementation! I also have a horrible habit of forgetting padding on the X axis until the very end, and this even fixes that! I would happily take a chunky grid boi over extra divs any day! Thanks for this video!

  • @sofocused7767
    @sofocused7767 ปีที่แล้ว

    Excellent solution.
    Everytime I watch I go and rewrite my css. This is just golden! Super simple to copy and paste to other projects as well.

  • @krisztinavajdarygard6725
    @krisztinavajdarygard6725 8 หลายเดือนก่อน

    I absolutely love this. I work on large e-commerce solutions, where especially on CMS pages it's be hard to control the number of DOM elements created due to wrapper divs all over the place. This approach will save so many now superfluous DOM elements 🙌🙌

  • @rcatyvr
    @rcatyvr ปีที่แล้ว

    This is the essence of good programming/design. Declare your variable structural properties at the beginning: variable first then static. You can then always come back to the top and make system-wide changes as needed. And yes, this is so portable.

  • @alirahmani5601
    @alirahmani5601 ปีที่แล้ว +17

    I'm definitely gonna explore this. I'm a big fan of CSS over HTML, so I'm willing to write more CSS to avoid repeating myself in HTML by cluttering my markup with many classes!

    • @tonyr.6637
      @tonyr.6637 ปีที่แล้ว +8

      CSS was invented to avoid *exactly* this kind of HTML clutter. You are helping it fulfill its destiny! 🔮

  • @MichaEl-rh1kv
    @MichaEl-rh1kv ปีที่แล้ว

    Perfect. Far more clean than those wrapper divs, and also perfect versatility, easy responsiveness, one-place-does-it-all for multiple projects,...
    Thank you!

  • @AlThePal78
    @AlThePal78 หลายเดือนก่อน

    this is awesome, the whole point of being creative is to minimize the use of container and media queries.

    • @AlThePal78
      @AlThePal78 หลายเดือนก่อน

      I like inherit column templates less writing i think

  • @MrJettann
    @MrJettann ปีที่แล้ว

    Currently I'm working on a react project and I had to use a lot different wrappers, containers etc, and it pain in a butt. This can solve all these problems easy and 1 nice thing about this approach, that you can use only one main wrappers, probably main tag itself and use all needed classes to implement full width or wrapper like behavior in seconds, when I'm react components you should be really carefull to not break everything, thank you Kevin, will definitely use it!

  • @mvonballmo
    @mvonballmo ปีที่แล้ว

    This was fantastic. Thank you very much. Really a tight tutorial, with just enough "mistakes" to show how you built it up. Not over-engineered at all. It's just as complex as needed, and no more. Responsive without media queries. Complexity hidden in the CSS. Even the CSS is reasonably legible. You could maybe use an extra variable to clean it up, but otherwise, great.

  • @codcut
    @codcut ปีที่แล้ว

    I was just doing some crazy stuff just to be able to breakout some parts of the content. Now I'm redoing everything because of you!

  • @thegeneralyst
    @thegeneralyst ปีที่แล้ว

    I think this is the next step to containers, while it does take a lot to setup it allows for complete control over how you want the containers to work and will save you a lot of time in the long run. I am definitely using this.

  • @artboeckchen1247
    @artboeckchen1247 ปีที่แล้ว

    I really like this approach. It's much tidier and logical for me. It preserves the semantics of HTML much better.

  • @Uncaught_in_promise
    @Uncaught_in_promise ปีที่แล้ว

    You could even not know frameworks like React or Vue, but still create amazing things just with Vanilla JS.
    Having a good command of CSS, HTML, JS makes you a wizard.

  • @wecm8991
    @wecm8991 ปีที่แล้ว

    I always thought that it won't hurt to use wrappers or containers if they make my life easier. But this solution is just awesome! Thanks for sharing!

  • @BarDots315
    @BarDots315 4 หลายเดือนก่อน

    thank you you are magician! I finally left the bad practice of using flex to organize my sections and i finally get a consistent spacing and structure

  • @jpmorse1982
    @jpmorse1982 ปีที่แล้ว

    I am a newbie to frontend design and these videos are a massive help thank you.
    I am currently building a help webpage for work and spent hours aligning sections where I wanted but using this idea to simply name a section and it positions and look how I wanted. I recreated my webpage with this idea and it took just minutes to do. Granted most of that time was setting this up but overall much quicker.

  • @nickbrown6754
    @nickbrown6754 ปีที่แล้ว

    I love this approach.
    I recently worked on a project where the designer had numerous column width / container sizes. This would have worked so well as I would have been able to set all container sizes to one grid layout instead of numerous container classes.

  • @gabrielsanmartin8326
    @gabrielsanmartin8326 2 หลายเดือนก่อน +1

    I've never thought that grid lines could be that useful.. Really good alternative to the container approach. I don't think this is overengineering since you can easily change your layout and even add more grid lines to create new things. Thanks!

  • @matthiasploetz998
    @matthiasploetz998 ปีที่แล้ว +4

    This is a lovely idea. I agree with a comment below "unless a container/wrapper makes sense semantically ...". Always start with good HTML. What I really like about it is having only one major grid to put your UI elements into. You can create an overall consistent spacing strategy throughout your page. I wonder though if most of the time it only ends up being a starting point and you end changing the grid multiple times before you are done. I guess it saves designers jobs if the web developer community all use the same one-column layout with 60 to 90ch max-width content. It should make more interesting grid layouts stand out even more.

  • @DominicRossYD33
    @DominicRossYD33 ปีที่แล้ว

    Mind. Blowm 🤯
    I love this idea. I hate the way a lot of modern websites are just div soup. You're inside a dozen div's before you even get to the content, it's nuts!

  • @marcofante
    @marcofante ปีที่แล้ว

    This is a GREAT way to handle dynamic components retrieved let's say from a CMS, leaving the editor full choice over the design, while keeping a smaller markup footprint, I like it!

  • @visuellegedanken
    @visuellegedanken 11 หลายเดือนก่อน

    I just love how happy this solution is making you. I'm very intrigued because I definitely feel the .wrapper pain. I'll give it a test run as soon as I start a new project.

  • @NicholasZein
    @NicholasZein 11 หลายเดือนก่อน

    I love the versatility of this

  • @ofcljaved
    @ofcljaved ปีที่แล้ว

    I absolute love it, It's a masterclass and it will take 2-3 rewatch to understand it but it'll help in long run

  • @CirTap
    @CirTap ปีที่แล้ว

    Nice! I knew that grid-area names create their implicit '-start' and '-end' tracks but this technique allows for *overlapping area names* which I didn't know was possible 🤯and *this* I find much more interesting to learn about!! 😁
    I use track names all the time and you can give them multiple names:
    auto [L side-start ads-start] 0.5fr [ads-end] 0.5fr [C side-end content-start] 2fr [R content-end] auto
    This gives us the *overlapping* areas side, ads, content plus three individual tracks L, C, R.
    Use these (short) names in spans to avoid "magic numbers":
    grid-column: L / R;

  • @joshreynolds4164
    @joshreynolds4164 ปีที่แล้ว

    Love it, I found Ryan's version of this a few months back and it's been so useful. As you say, can kind of just drop into projects and update the variables as needed

  • @jordondavidson3405
    @jordondavidson3405 ปีที่แล้ว

    Honestly, this looks like a great starting point for a layout system, especially for a component-driven cms. When working in a Bootstrapesque system with a "container" div, landing pages are particulary hard to create when you need to mix full-width and contained elements. This is a very elegant solution to that use case.

  • @7oca7hos7
    @7oca7hos7 4 หลายเดือนก่อน

    this is a perfect solution for customizing the content output of a CMS without having the end user to add a bunch of divs or classes

  • @senorverano
    @senorverano ปีที่แล้ว +1

    Ok, I think this is indeed awesome. Especially since the flow of the document doesn't get interrupted as much as it does with the container/wrapper way of doing it!

  • @davidneighbour1126
    @davidneighbour1126 ปีที่แล้ว

    I like this because it simplifies the html and reduces noise and the need to define unique container classes.
    Although the container div is more visible. It is a matter of training yourself to look for style classes instead of a div container.
    Everyone has their own style of writing html and css. I find that most just keep patching css which causes unnecessary noise in the code.

  • @AgentProvocateur42
    @AgentProvocateur42 ปีที่แล้ว

    This approach keeps your HTML clean and tight - really nice for accessability.

  • @jhasani79
    @jhasani79 ปีที่แล้ว

    This actually solved a problem I was working on. Thank you so much for this! And yes, it is a bit of a setup, but I think in the long-run it saves so much time and effort.

  • @AndreeaCozariuc
    @AndreeaCozariuc 19 วันที่ผ่านมา

    Wow, I love this sooooo much! I really hate having a way too crowded HTML because of the containers and wrappers needed for this type of layout so your solution is like a dream come true. I also realized I'm not that knowledgeable in regards to Grid or modern CSS as I thought I was 🤯

  • @cat_copilot
    @cat_copilot ปีที่แล้ว

    You effectively created a subgrid-like effect without relying on the CSS 'subgrid' property, well done!
    This could have saved me a lot of time in the past styling CMS content.

  • @floodlitworld
    @floodlitworld ปีที่แล้ว +1

    One "Gotcha" to be aware of with this is that grid elements do not apply margin-collapse, so if you've set a margin-top and a margin-bottom for the elements directly descendant to a grid, both margins will be applied.
    Personally, I would advise dropping margin-top altogether and only using single-direction margins.

    • @dusanstojanovic3759
      @dusanstojanovic3759 ปีที่แล้ว

      Exactly! I have a very specific set of margins and this approach breaks all the typography

  • @marymaundu1702
    @marymaundu1702 ปีที่แล้ว

    Hey Kevin. Just want to say thank you so much because I have finally conquered responsive layouts and I'm super proud of myself but also so grateful for your course and guidance. I have finished the final challenge of conquering responsive layouts and I can now confidently create responsive sites. No longer dreading CSS but actually love it now.😅😊

  • @HansBauer-hg1xj
    @HansBauer-hg1xj 2 หลายเดือนก่อน

    This is really cool. And you already did all the work for us. I think it's awesome.

  • @leno-design
    @leno-design ปีที่แล้ว +1

    First, thanks for the great explanation, Kevin, as always! Both approaches work well with full-width if you have simple markup with one or two elements as children for each section. but, in real projects, we're often dealing with more complex markup, and what if you want the section to be flex instead of grid? I encourage you to try it with a more complex layout in the section, and you'll see its limitations. Thanks again for such great content.

  • @tictac1020
    @tictac1020 11 หลายเดือนก่อน

    Excellent stuff, Kevin. Have taken a break from front of the front end stuff for a bit and am jumping back in and seeing what I've missed. Glad to see you are still bringing the light of CSS to the masses.

  • @deathscry1
    @deathscry1 ปีที่แล้ว +1

    Kevin I think I'll say what most of us think.. It's great and we love ❤ it!
    I think I'll take some time and see how would it look when implemented on my website and then get back to everyone. That might be the best way to verify the idea. I also use the same (way simpler) technique already with grid for padding and main content so it should be fairly "easy" to replace.
    Also thank you for the tip about named lines didn't know that was a thing.

  • @gerr_cass
    @gerr_cass ปีที่แล้ว

    love the idea. It seems like that kind of things you only need to get used to. Less wrappers also sounds like a good idea. Thank you.

  • @jshstuff
    @jshstuff ปีที่แล้ว

    I also came up with this same strategy on my own and have been applying it to redesigns of some major sites because I love it so much. A few weeks ago I pasted my version under your video about escaping a container on only one side - when you made the teaser community post I actually thought you got the idea from me since I'd never seen anyone do this kind page layout and I'd just shared my code like 2 days earlier, but I guess it's humbling to hear that people discovered the same thing over a year ago :)

  •  ปีที่แล้ว

    This is an amazing idea for CDN documents used in different platforms or CMS used by content creators who don't have the time or patience to understand and learn HTML and CSS.
    Less HTML voodoo for content creators, more fun for front-end devs!

  • @joaquingarcia7075
    @joaquingarcia7075 ปีที่แล้ว

    Awesome, love it! The full width and the breakout are so needed in projects, and this is a clever way to get through them and not have to make a lot of CSS to get to the same result with a conventional container.

  • @error-bl4dm
    @error-bl4dm 11 หลายเดือนก่อน

    been looking for this solution a long time, I have this bad habit of putting everything into divs and just throw a grid and do specific styles or what. Damn helpful for doing content managements for front end developments kudos to you my guy

  • @adammarostica3016
    @adammarostica3016 ปีที่แล้ว

    I absolutely love this! Set it up once and then you’re set. This is brilliant. Thanks, Kevin!

  • @fathercashew
    @fathercashew ปีที่แล้ว

    Wild to see something I've been re-engineering for years crystallized here in such an elegant way. This is the missing link to what I've been working towards - my solution involved a lot of CSS properties and calcs, but this is much more seamless and is still very robust.
    This kind of solution is far superior to wrappers, in my opinion. Yeah, it's a lot of set up at first, but then you can use in a utilitarian way and then just tweak the global values from project to project. Not to mention we get to kill one more layer of styling-only divs. 🎉
    Also, huge thank you for cluing me into the fact that you can use simple line naming to define grid areas. I will be using that immediately. Thank you!

  • @maxfri6680
    @maxfri6680 ปีที่แล้ว

    This is such a clean solution. 😱
    Also because grids are perfect tools for animations with fr units and using this layout will open up a lot of possibilities.
    Thank you for sharing!

  • @CyberTechBits
    @CyberTechBits 5 หลายเดือนก่อน

    No @media queries for all the different screen widths, including mobile, is PRICELESS!

  • @catalinim4227
    @catalinim4227 ปีที่แล้ว

    I've never liked containers and wrappers, so I'm going to use this from now on.

  • @thatianallen
    @thatianallen 10 หลายเดือนก่อน

    I think this is a really cool approach. Cleaner HTML and less media queries, WIN!

  • @abramthau558
    @abramthau558 ปีที่แล้ว +2

    Kevin, I've watched a lot of your videos, and this is the first time I've felt compelled to comment because this is FREAKING. AWESOME. I will definitely be using this technique, plus I love the whole named lines to make implicit grid areas!

  • @iskimo01
    @iskimo01 ปีที่แล้ว

    You just made me rethink the whole concept of grids!

  • @olegkremianski5744
    @olegkremianski5744 ปีที่แล้ว

    I like this approach, Kevin. It seems to be more flexible for more complex designs. Thank you.

  • @richardhulse9328
    @richardhulse9328 ปีที่แล้ว +1

    I just used this for something I am working on. There is probably 50% less CSS and HTML overall to using containers and wrappers, based on what I have done in the past. I like that you can have everything in one place instead of it being strewn over the HTML and many class definitions.

  • @calum303
    @calum303 10 หลายเดือนก่อน

    I like the idea of using both class names rather than making the .full-width class have more than one responsibility.
    `` feels great. Like using Tailwind utility classes.
    Overall, love the idea of using grid this way. Thanks for another great video Kevin.

  • @theomegamale5335
    @theomegamale5335 ปีที่แล้ว +1

    This is going to make my life really easy with a platform i am developing right now. Im someone who hates extra html, so this succinct kind of approach is phenomenal. Great video !

  • @TreeborXL
    @TreeborXL ปีที่แล้ว

    @KevinPowell - I have been using dynamic padding left and right to solve this problem for a long time, something like:
    .padding-700 > * {
    padding-left: max(clamp(15px, 5vw, 60px), calc(50% - 350px));
    padding-right: max(clamp(15px, 5vw, 60px), calc(50% - 350px));
    }
    The above CSS would give a 700px width to all the sub content. I feel this gives a much better responsive solution. In the case you were looking at you would only need three classes to achieve the same result, no extra div and no media queries. FYI, I use padding left/right as I often want to add padding top and bottom via a different class.

  • @zizak143
    @zizak143 10 หลายเดือนก่อน

    I love it, especially when editing legacy content on larger repository, this way I can go in with css and no need to touch the html and change the whole layout. Very interesting idea

  • @INDABRIT
    @INDABRIT ปีที่แล้ว

    I love it. Like you said, copy and paste the content grid elsewhere, play with the variables if need be, and keep the html much cleaner

  • @IanPitts
    @IanPitts ปีที่แล้ว

    Honestly this is life changing. As soon as my UX department creates a design where I can use this I will be using it.

  • @paulhuckstepp2410
    @paulhuckstepp2410 ปีที่แล้ว

    Absolutely genius. That is such an impressive solution. Definately going to be using this method on the sites I build.