Git Product home page Git Product logo

Comments (2)

stubbornella avatar stubbornella commented on June 12, 2024

I agree, I've moved the whole media query into a separate stylesheet so we can work out the kinks without impacting existing styles. I don't want to add classes to every unit to make this work, but perhaps there is a way to make it cascade down, so you add the class at any level and it works on all units below that? Not sure it is a good idea... hmm.

from oocss.

neonstalwart avatar neonstalwart commented on June 12, 2024

i agree that adding classes to every unit that you want to have 'collapse' is maybe not ideal.

perhaps there is a way to make it cascade down, so you add the class at any level and it works on all units below that

with what i'm trying to achieve, i would need the added class to protect anything below that class - ie the class would need to reverse the effect of the media query so that the media query would work just as it does now but i could prevent the media query from affecting a block of content by adding a class that would do what unit does without the media query being in play. for example, the content in the first block (with the protectFromMedia class) would need to appear to be unaffected by the media query.

<div class="line">
    <div class="unit size1of2 protectFromMedia">
        <div class="unit size1of3">Not affected</div>
        <div class="unit size1of3">by</div>
        <div class="unit size1of3 lastUnit">media query</div>
    </div>
    <div class="unit size1of2 lastUnit">
        <div class="unit size1of2">affected by</div>
        <div class="unit size1of2 lastUnit">media query</div>
    </div>
</div>

i don't mean to suggest that the class should be called protectFromMedia - that was just to make it clear

from oocss.

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.