Giter Site home page Giter Site logo

Comments (5)

connorskees avatar connorskees commented on August 20, 2024

From what I can tell, support for the keyword "or" is a CSS media query level 4 feature. libsass wouldn't have support for media queries level 4, as Sass (the language) added support several years after libsass was EOL'd. As a workaround you should be able to use commas (e.g. @media (prefers-color-scheme: light), (min-width: 0px) {}).

Also see sass/sass#2538

from libsass.

vadimkantorov avatar vadimkantorov commented on August 20, 2024

Oh, I never realized that libsass was deprecated :(

Are there any plans of Python bindings for the Sass-Dart?

I found it very nice to use SASS without any npm/webdev setup using https://sass.github.io/libsass-python/

As a workaround

Yeah, that's how I worked it around, yes. I managed to make a fully symmetrical auto/light/dark switches using some hacky media queries:

@charset "utf-8";

$colorscheme: "auto" !default;

$falsemediaquery: 1000000px;
$truemediaquery: 0px;

$forcelight: $falsemediaquery;
$forcedark: $falsemediaquery;

@if $colorscheme == "light" {
    $forcelight: $truemediaquery;
    $forcedark: $falsemediaquery;
}
@if $colorscheme == "dark" {
    $forcelight: $falsemediaquery;
    $forcedark: $truemediaquery;
}

@media (prefers-color-scheme: light) and (max-width: $forcedark), (min-width: $forcelight)  {
    :root { /* light mode blah */ }
}

@media (prefers-color-scheme: dark) and (max-width: $forcelight), (min-width: $forcedark) {
    :root { /* dark mode blah */ }
}

from libsass.

vadimkantorov avatar vadimkantorov commented on August 20, 2024

I found https://pypi.org/project/dart-sass/, but not sure if it's officially supported

from libsass.

connorskees avatar connorskees commented on August 20, 2024

That project is not officially supported and hasn't been updated in 2 years. It looks like all it does it call into the precompiled dart-sass binary. You could probably write something similar pretty quickly, depending on your use case.

from libsass.

vadimkantorov avatar vadimkantorov commented on August 20, 2024

Thank you! I created a separate issue in https://github.com/sass/dart-sass !

from libsass.

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.