Code Monkey home page Code Monkey logo

Comments (6)

Snugug avatar Snugug commented on September 23, 2024

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.

luksak avatar luksak commented on September 23, 2024

+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.

Snugug avatar Snugug commented on September 23, 2024

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.

luksak avatar luksak commented on September 23, 2024

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.

Snugug avatar Snugug commented on September 23, 2024

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.

luksak avatar luksak commented on September 23, 2024

Oh... Uhm, then I don't see a solution either and Zen Grids should integrate. Marking as closed.

from breakpoint.

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.