Comments (6)
This is not something we can do because Sass doesn't have the ability to scope variables like that. We have +breakpoint-get-context()` as a function you can call to get the media query scope if you're inside Breakpoint, and use that in combination with a custom mixin to write widths, but that's something you're going to need to do on your own.
What it really sounds like you want to do is be able to use multiple grids with Zen Grids. I would direct you over to that issue queue and make a feature request there, as that's something that (from what I see in their documentation) is something that needs to be done from that end.
With that said, a separate feature request may be "Allow users to specify custom breakpoint contexts" but that's a different conversation and it's not something I'm 100% sure we can do.
from breakpoint.
+breakpoint-get-context() doesn't allow me to get variables but only the value of that feature. So that is not going to integrate Zen Grids, right?
What I am seeingis that a much simpler solution is not to use Breakpoints but something like this:
http://css-tricks.com/media-queries-sass-3-2-and-codekit/
This gives me total flexibility and I am able to use Zen Grids with it. What do you think? Maybe there should be a way to define breakpoints and be able to pass optional variables that are always available when using it.
from breakpoint.
I think it's possible you don't understand what Breakpoint does. Breakpoint is an abstracted, universal way to have that simple breakpoint mixin, but without having to write it each and every time. If all you're going to do is rewrite that mixin without adding anything else, Breakpoint does all of that and more.
Sass does not allow you to locally scope variables to media queries and share them between different definitions. Period. Regardless of the method you use to create those media queries.
If, however, you were to write your own mixin that had logic in it besides media queries, then by all means, do that. You can, though, wrap Breakpoint so your custom mixin performs the logic you want and uses Breakpoint to actually write your Media Queries (again, that's what Breakpoint does, write Media Queries).
The issue appears to be the magic way Zen Grids builds its width. If there's a function you can call to generate the width from your variables, then you can create a function using breakpoint-get-context
to determine which set of grid setup stuff to use and then return the correct grid, that's what you want. With that said, that's really a feature request for Zen Grids.
from breakpoint.
Yeah, I got what it does.
All I am saying is that it would be nice to have this ability. I do not have the required knowledge about Sass to determine a way of doing this.
Wouldn't it be possible to set variables prefixed with something like breakpoint-variables-[media-query]-[name-of-definded-variable] and set them each time the media query queries are used? It's kinda ugly but would that do the trick?
from breakpoint.
No you can't; Sass doesn't allow for dynamic variable generation
On Oct 4, 2012, at 12:32 PM, Lukas von Blarer [email protected] wrote:
Yeah, I got what it does.
All I am saying is that it would be nice to have this ability. I do not have the required knowledge about Sass to determine a way of doing this.
Wouldn't it be possible to set variables prefixed with something like breakpoint-variables-[media-query]-[name-of-definded-variable] and set them each time the media query queries are used? It's kinda ugly but would that do the trick?
—
Reply to this email directly or view it on GitHub.
from breakpoint.
Oh... Uhm, then I don't see a solution either and Zen Grids should integrate. Marking as closed.
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.