Giter Site home page Giter Site logo

Comments (8)

johno avatar johno commented on May 2, 2024 2

That's a great idea. I've gone ahead and spiked out an implementation (#66) that also adds further customization allowing you to pass an object instead of a media query value for further configurability:

customMedia: [
     { "sm": "600px" },
    { "md": "960px" },
    { "lg": "1280px" },
    { "xl": "1920px" },
    { "gt-xs": { "value": "600px", "minWidth": true } },
    { "gt-sm":  { "value": "960px", "minWidth": true }  },
    { "gt-md":  { "value": "1280px", "minWidth": true }  },
    { "gt-lg":  { "value": "1920px", "minWidth": true, "prefix": true, "delimiter": "@" }  }
]

The last mq options make the class naming become db@gt-lg for that breakpoint : )

from generator.

ctaepper avatar ctaepper commented on May 2, 2024

while you're at it, you could also add maxWidth - although that does not really target mobile-first

from generator.

johno avatar johno commented on May 2, 2024

Done < 3

from generator.

ctaepper avatar ctaepper commented on May 2, 2024

@johnotander works great!

except one thing:

  "customMedia": [
    { "xl": "1920px" },
    { "gt-lg": {"value": "1920px", "minWidth": true }}
  ],

the 2nd breakpoint doesn't get generated. i haven't looked into the code, but I assume it has something todo with both resulting in screen and (min-width: 1920px)

I am aware that it doesn't really make sense to have 2 identical breakpoints... the semantic meaning though is different. bottom line: I'm unsure if this is a bug or a feature

from generator.

johno avatar johno commented on May 2, 2024

I'll look into it to see what's going on today. Definitely think its a bug since they're named differently.

from generator.

johno avatar johno commented on May 2, 2024

Hey @ctaepper,

Just ran the generator with the xl and gt-lg media queries and they both seem to be generated for me. Are you sure the second isn't being generated?

from generator.

ctaepper avatar ctaepper commented on May 2, 2024

I'm sorry, I have more breakpoints and I didn't realize, that the 2 breakpoints got merged together within one single media query

from generator.

johno avatar johno commented on May 2, 2024

No worries, glad it works! 😸

from generator.

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.