Giter Club home page Giter Club logo

Comments (10)

jacmanh avatar jacmanh commented on August 29, 2024

Yes you should, if you don't do it it's not working anyway :)
Look at the demos on leejordan's website : http://leejordan.github.io/reflex/docs/demo.html

If look at the second grid styles, you should see :
flex: 1 1 auto;
It's like reseting the grid if i'm not wrong.

from reflex.

andrewQwer avatar andrewQwer commented on August 29, 2024

thanks @jacmanh

Yes you should, if you don't do it it's not working anyway :)

It works even without additional grid wrapper that is why I am asking :)

from reflex.

jacmanh avatar jacmanh commented on August 29, 2024

Are you sure ? I just test it and it doesn't with this code :

<div class='grid'>
            <div class='grid__col-12'>
                <div class='grid__col-4'>tt</div>
                <div class='grid__col-4'>ii</div>
                <div class='grid__col-4'>oo</div>
            </div>
        </div>

If you tested it with your code above, it will work because you misspell grid__col12, you forgot a dash.

from reflex.

andrewQwer avatar andrewQwer commented on August 29, 2024

Take a look at this example please https://jsfiddle.net/wstezt1k/
The only difference is that grid wrapper doesn't required grid--direction-row as it is by default for grid. But for grid__col-x we need to define it explicitly

from reflex.

leejordan avatar leejordan commented on August 29, 2024

Well as you discovered it's fairly flexible and you can do it either way - either with a grid nested inside a grid__col or by setting grid--direction-row on the parent grid__col. Either works and I use both in production on my various websites.

However I would argue that nesting a grid inside a grid__col before setting further grid__col elements is the most understandable way of doing it because you're explicitly saying "this is a child grid of a parent grid"

from reflex.

andrewQwer avatar andrewQwer commented on August 29, 2024

Thank you!

from reflex.

frabonomi avatar frabonomi commented on August 29, 2024

Though if you want to follow BEM rules, you wouldn't apply a modifier of grid to grid__col. grid--direction-row should just be applied to an element that has the grid class.

from reflex.

leejordan avatar leejordan commented on August 29, 2024

That's a good point too. There's a few occasions where a class can be applied to either a grid or a grid__col. Would you advocate creating two separate classes for that purpose even though they would apply the exact same properties?

from reflex.

frabonomi avatar frabonomi commented on August 29, 2024

That's what I would do honestly, even if that results in a longer class. What are the classes that you can apply to both grid and grid__col currently?

from reflex.

andrewQwer avatar andrewQwer commented on August 29, 2024

But what if I want row direction for grid__col-x element?

from reflex.

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.