Comments (8)
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.
while you're at it, you could also add maxWidth - although that does not really target mobile-first
from generator.
Done < 3
from generator.
@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.
I'll look into it to see what's going on today. Definitely think its a bug since they're named differently.
from generator.
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.
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.
No worries, glad it works!
from generator.
Related Issues (20)
- Type scale breakpoint usage HOT 1
- 666
- Curl Output HOT 4
- missing backslash \ after the "json" HOT 1
- Missing units HOT 1
- Generate different files for different prefix HOT 2
- Name and define new colors? HOT 2
- semantic aliasing HOT 1
- Add rtl option
- add ability to disable/remove modules HOT 2
- trying to skip colors module HOT 2
- spacing default in config HOT 1
- Roadmap? HOT 1
- white & black opacity class names
- Possibility to remove the normalize.css that comes with tachyons
- Why are debugChildren and debugGrid classes not included in the generated bundle
- Is this repo not mantained anymore? HOT 2
- Allow to pass CSS variables to the JSON files HOT 4
- adding inherit as a "colour"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from generator.