Coder Social home page Coder Social logo

Comments (8)

mmahalwy avatar mmahalwy commented on May 26, 2024

I think in styles.loader.js, the custom file needs to come before the variables file
Notice: https://github.com/twbs/bootstrap-sass/blob/master/assets/stylesheets/bootstrap/_variables.scss#L18

If it comes before, it overrides it. Otherwise, for some reason, it's not getting pushed down?

from bootstrap-sass-loader.

justin808 avatar justin808 commented on May 26, 2024

@mmahalwy Order is important for sass. That's why there's two separate customization files. One for variables, and one for overriding the styles after they are declared. However, I think your point is valid.

The issue is that $brand-primary is being used by the other styles. I've only set $brand-primary and the other styles explicitly.

Based on checking the docs, I'd agree that we should change the order.

If I create a branch, will you try it out? Alternately, can you create a branch and create a PR? It would be nice to modify the example as well to show this use case.

Here's a reference: https://robots.thoughtbot.com/sass-default

from bootstrap-sass-loader.

justin808 avatar justin808 commented on May 26, 2024

Actually, I'll create a branch. Very simple.

from bootstrap-sass-loader.

justin808 avatar justin808 commented on May 26, 2024

@mmahalwy I'm not sure what to do about this one. I just tried, but in my use cases, I always refer to other bootstrap defined variables in my customization file. Check this out:

https://github.com/justin808/bootstrap-sass-loader-example/blob/master/_bootstrap-customizations.scss#L6

I'm guessing that I should just add another optional customization file. How's this look:

  // Use preBootstrapCustomizations to change $brand-primary. Ensure this preBootstrapCustomizations does not
  // depend on other bootstrap variables.
  preBootstrapCustomizations: "./_pre-bootstrap-customizations.scss",

  // Use bootstrapCustomizations to utilize other sass variables defined in preBootstrapCustomizations or the 
  // _variables.scss file. This is useful to set one customization value based on another value.
  bootstrapCustomizations: "./_bootstrap-customizations.scss",

from bootstrap-sass-loader.

justin808 avatar justin808 commented on May 26, 2024

See #10

@mmahalwy Please try this and if it works for you, I'll push a new build.

See http://forum.railsonmaui.com/t/debugging-nodejs-and-webpack-loaders/142 for how to npm link to setup local copies, or specify the repo and branch in your package.json file.

I also created this to demonstrate the fix:
shakacode/bootstrap-sass-loader-example#3

Thanks for the input!

from bootstrap-sass-loader.

justin808 avatar justin808 commented on May 26, 2024

@mmahalwy If you look at this example, you can see how the package.json references the branch: shakacode/bootstrap-sass-loader-example#3

bootstrap-sass-loader": "justin808/bootstrap-sass-loader#fix-order-defaults-sass-import",

2__default__git_show__git_

from bootstrap-sass-loader.

mmahalwy avatar mmahalwy commented on May 26, 2024

@justin808 going to give it a try later this evening. Sorry, lazt sunday and I am out :)

I'll try the PR and the examples and +1?

from bootstrap-sass-loader.

mmahalwy avatar mmahalwy commented on May 26, 2024

Solved!

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.