Coder Social home page Coder Social logo

Comments (7)

jrief avatar jrief commented on July 22, 2024

I see, you mean @import "somefile"; where _somefile.scss does not contain CSS rules, but only stuff which does not materialize into CSS, for instance mixins, variables and functions.

Hmm, difficult to achieve since the sourcemap is the only feasible source which can be used for dependency tracking. Do you have a better idea?

from django-sass-processor.

Skynet0 avatar Skynet0 commented on July 22, 2024

My specific setup is something like

css/
  components/
    _button.scss
    _table.scss
  main.scss

Where _button.scss and _table.scss contain declarations, and main.scss contains

@import "components/button";
@import "components/table";

I include <link href="{% sass_src 'css/main.scss' %}" rel="stylesheet" type="text/css" /> in my base template.

If I add a new component _header.scss, main.scss isn't in the sourcemap and therefore an added @import won't be picked up. The scenario you mentioned would likely run into the same general problem.

I don't have a clean solution off the top of my head, unfortunately. Some meh candidates:

  • Add an optional "always recompile" argument to the tag (would solve the problem, but not at all elegantly)
  • Specify extra files to watch for a particular sass_src (too long to put in the tag; feels clunky to do it in settings)

At the least, adding documentation for this behavior + a workaround would be appreciated.

from django-sass-processor.

jrief avatar jrief commented on July 22, 2024

If I add a new component _header.scss, main.scss

Do you want to say:

"If I add a new component _header.scss to main.scss … "?

I just checked on my own system. In the sourcemap main.css.map the first entry in sources: […] must be main.scss. This means that touching main.scss triggers a recompilation.

from django-sass-processor.

Skynet0 avatar Skynet0 commented on July 22, 2024

Do you want to say:

"If I add a new component _header.scss to main.scss … "?

Yes, thanks.

Ah, I see -- I forgot to mention that I use dart-sass (on M2 MacOS) via https://pypi.org/project/django-sass-processor-dart-sass/. I just checked with libsass, and see the behavior you describe.

from django-sass-processor.

jrief avatar jrief commented on July 22, 2024

so then, can this be closed?

from django-sass-processor.

Skynet0 avatar Skynet0 commented on July 22, 2024

Sounds right, yes. I'll open an issue against the other package as an FYI.

from django-sass-processor.

jrief avatar jrief commented on July 22, 2024

django-sass-processor shall be refactored towards dart-sass anyway. There are many nice features such as @use which are not supported by libsass.

from django-sass-processor.

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.