Comments (3)
Isn't there already support for this?
Something along the lines of:
$small: 500px;
$large: 900px;
$medium: $small $large-1;
@include breakpoint($small) {
-foo: bar;
}
@include breakpoint($medium) {
-baz: stuff;
}
from breakpoint.
Wrote up a longer response to this, but it's gone missing. I'll give the long and short of it now:
Currently, you can nest breakpoint
mixins to your heart's content and they'll work identically to how Sass nests media queries (although we have yet to write code to have breakpoint-get-context
working under this scenario). I'm very concerned about magic destructive manipulation like what is proposed. This kind of thing becomes exceedingly hard to debug very quickly as the transformation is both a subtle one and a non-directed one (the conversion to ems
, for instance, is both non-subtle and behind a flag, making it very easy to spot, done intentionally w/o the possibility that it was done by accident, and fairly easy to debug). This also changes how Sass natively handles nested media queries, and I'm not entirely sure I like that. I also do not like the idea that, as proposed, it seems to only work with width
queries; it would need to work with all features that allow for min/max
queries. One of the largest challenges one would have going to implement this is aspect-ratio
both allows for min/max
queries and must be written as strings and we don't want to add additional Ruby functions to accomplish new functionality.
@canarymason What are your thoughts?
from breakpoint.
This feels like it goes in the 'too clever by half' category. Since it disrupts the normal Sass nested MQ behavior I'd like it to solve a much larger problem than it does. It's currently pretty easy to write the MQ's you want Your proposal makes for some pretty code, but I don't think it makes writing the code much faster or very much easier to write. Once you add a few other tests to these nested queries I think it might even lose those benefits. I agree with all the points @Snugug raises. That said I'm not 100% opposed to it under some conditions:
- I'd like to see some examples of how this will work with more complex examples
- needs to be behind a very clear settings flag
- needs to support all (and complex) nested queries. I don't want this to only support the default test.
- I don't want the source code to get terribly complex to support this. I would have to be well compartmentalized.
- no new Ruby. we're trying to move away from the Compass dependency.
from breakpoint.
Related Issues (20)
- How to import breakpoint with webpack? HOT 5
- Sourcemaps Issue Stylesheet could not be loaded...
- W3C error on min-aspect-ratio and max-aspect-ratio
- Spelling mistake in error message in _legacy-settings.scss
- component/sass/styles.scss (Line 3: File to import not found or unreadable: breakpoint.
- Consider using >=0.8.2 for eyeglass "needs"
- Can't seem to extend a placeholder or class which consists solely of media query content coming from Breakpoint HOT 2
- Typo in documentation
- Installation for breakpoint doesn't work
- Can media queries be grouped in css? HOT 1
- eyeglass usage notes
- Using "only screen" with the mixin HOT 1
- can't override default variables HOT 1
- Dual license clarification HOT 2
- Sass needs to be replaced as it is EoL HOT 1
- Are Level 4 Media Queries supported??? HOT 3
- licence MIT AND/OR GPL HOT 1
- breakpoint doesn't work with sass 1.49.9 because of breaking change: slash as division HOT 5
- Breakpoint v3.0.0 is incompatible with Python libsass
- hover: hover doesn't work because of missing value in variable
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 breakpoint.