Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom variables in a different directory #94

Closed
tacman opened this issue Mar 2, 2021 · 1 comment
Closed

Custom variables in a different directory #94

tacman opened this issue Mar 2, 2021 · 1 comment

Comments

@tacman
Copy link

tacman commented Mar 2, 2021

I've installed admitkit via yarn, so that it's downloaded into node_modules and I don't have to check it into my repository.

My webpack.config.js file is at the root, and contains

    .addEntry('adminkit', './node_modules/adminkit/src/js/app.js')

I'm trying to figure out how to customize the variables in _custom.scss without modifying files in the node_modules directory:

// Variables
@import "1-variables/variables";
@import "1-variables/custom";

What I think I want to do is create a 1-variables/_custom.scss in my /asset/styles directory (which is checked into source control), and then set webpack to first check my directory for a matching filename, and use it if it exists.

This is further complicated by the fact that I'm using Webpack Encore (a wrapper to simplify Webpack), and that I really don't know what I'm doing. I'm learning a lot by looking at your code, it's clean and elegant, and I'm quite pleased to be using it.

I realize this is more a webpack question than admitkit, this is what I was asking in another issue about documenting integration. I'm working on a Symfony bundle that uses adminkit and integrates some core functionality like creating the sidebar menu.

Thanks.

@paullaros
Copy link
Contributor

All of the variables (in /src/scss/1-variables/_variables.scss) contain the !default flag, and can be overwritten using Sass. Learn more here: https://thoughtbot.com/blog/sass-default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants