Code Monkey home page Code Monkey logo

Comments (3)

azanebrain avatar azanebrain commented on September 23, 2024

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.

Snugug avatar Snugug commented on September 23, 2024

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.

codingdesigner avatar codingdesigner commented on September 23, 2024

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)

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.