Coder Social home page Coder Social logo

Comments (11)

vjpr avatar vjpr commented on June 6, 2024 1

So I have switched to bootstrap-loader and sass-resources-loader.

I now have a file called variables.scss referenced in webpack.config.js in sassResources which contains:

@import './pre-customizations.scss';
@import '../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/_variables.scss';
@import './customizations.scss';

This works well.

from bootstrap-sass-loader.

justin808 avatar justin808 commented on June 6, 2024

Hi @vjpr If you have one sass file, then so long as you defined the variable, you can see it.

By this, I mean, you need to put your sass in this config (name the file as you please). Then you can see all the bootstrap mixins, variables, etc.

  mainSass: "./main.scss", // path to your main SASS file (optional)

from bootstrap-sass-loader.

vjpr avatar vjpr commented on June 6, 2024

I have a lots of sass files and they are required individually using webpack. I just want to import the variables. Sounds like it's not possible?

from bootstrap-sass-loader.

justin808 avatar justin808 commented on June 6, 2024

Hi @vjpr, that's not the way that sass works.

from bootstrap-sass-loader.

vjpr avatar vjpr commented on June 6, 2024

It's how webpack loaders work. Each file is compiled into css. Then it is appended to the header in a style tag.

The way I am thinking is importing the bootstrap variables. Then importing the precustomization file with my modifications to the variables. Then I can access the variables.

from bootstrap-sass-loader.

justin808 avatar justin808 commented on June 6, 2024

@vjpr we're changing the way we're doing the assets parts as shown here: https://github.com/shakacode/react-webpack-rails-tutorial/

See our npm "sass-resources-loader"...

We'll have some more docs on this in the next couple of weeks.

The sass-resources loader will prepend any common definition files, which sounds like what you want!

from bootstrap-sass-loader.

alex35mil avatar alex35mil commented on June 6, 2024

@vjpr bootstrap-loader + sass-resources loader will solve it.

from bootstrap-sass-loader.

alex35mil avatar alex35mil commented on June 6, 2024

@vjpr Great, glad it helped 👍

from bootstrap-sass-loader.

damassi avatar damassi commented on June 6, 2024

After looking high and low for a solution, sass-resources-loader did it. Might be worthwhile to add a note in the bootstrap-loader README. 👍

from bootstrap-sass-loader.

justin808 avatar justin808 commented on June 6, 2024

@damassi Any chance that you can give us a PR note to the README.md. @alexfedoseev and I would super appreciate it! We're slammed with our new product release.

from bootstrap-sass-loader.

damassi avatar damassi commented on June 6, 2024

Will do.

EDIT: Just noticed that it is there, but that I missed it. Thanks!

from bootstrap-sass-loader.

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.