I can't seem to find many tutorials about over-riding colors in Materialize in Sass. The only tutorial I can find is on downloading the Sass files and then integrating this in the project directly by editing the _variables.scss and re-compiling to get the new CSS file.
Ideally I would like to use the NPM package so I don't have to manually keep updating the Sass folder. So, my aim is to use the NPM package "materialize-css" and over-ride the colors in Sass somehow.
I have setup a React test project. The code I have is as follows:
INDEX.JS
import React from 'react';
import ReactDOM from 'react-dom';
import './index.scss';
import App from './App';
import "materialize-css/dist/js/materialize.min.js"; //This is for JS functionality
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
);
index.scss
@import "materialize-css/sass/materialize.scss";
// $primary-color: #346BA7 !default;
// @import "materialize-css/sass/components/_variables.scss";
// **The commented lines above do not work**.
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
}
...
In the index.scss, this is where I would like to do the theming. Could anyone please point me in the right direction?
Thank you.