how to change color theme in materializecss
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I have created nodejs project. Here is package.json
{
"name": "materializecssdemo",
"version": "1.0.0",
"description": "Use of material design components",
"main": "index.js",
"scripts": {
"prestart": "node-sass ./scss/theme.scss ./css/materialize-theme.css",
"start": "lite-server",
"test": "echo "Error: no test specified" && exit 1"
},
"author": "Sunil Kumar",
"license": "ISC",
"devDependencies": {
"lite-server": "^2.3.0"
},
"dependencies": {
"materialize-css": "^0.100.2",
"node-sass": "^4.7.2"
}
}
I just want to change the colour of my app from its default colour to blue. So I have created theme.scss file and using node-sass module trying to generate CSS file. Here is my theme.scss
$primary-color: color("blue", "lighten-2") !default;
@import "../node_modules/materialize-css/sass/materialize";
but this is showing
{
"status": 1,
"file": "D:/SK/Study/MaterializeCSSDemo/node_modules/materialize-css/sass/components/_variables.scss",
"line": 39,
"column": 23,
"message": "argument `$color` of `lighten($color, $amount)` must be a colornnBacktrace:ntnode_modules/materialize-css/sass/components/_variables.scss:39, in function `lighten`ntnode_modules/materialize-css/sass/components/_variables.scss:39",
"formatted": "Error: argument `$color` of `lighten($color, $amount)` must be a colornn Backtrace:n tnode_modules/materialize-css/sass/components/_variables.scss:39, in function `lighten`n tnode_modules/materialize-css/sass/components/_variables.scss:39n on line 39 of node_modules/materialize-css/sass/components/_variables.scssn>> $primary-color-light: lighten($primary-color, 15%) !default;n ----------------------^n"
}
is there any simple and clean way to make modifications to the theme? On the documentation page, it is saying by changing the _variables.scss file directely.
css node.js materialize
add a comment |
I have created nodejs project. Here is package.json
{
"name": "materializecssdemo",
"version": "1.0.0",
"description": "Use of material design components",
"main": "index.js",
"scripts": {
"prestart": "node-sass ./scss/theme.scss ./css/materialize-theme.css",
"start": "lite-server",
"test": "echo "Error: no test specified" && exit 1"
},
"author": "Sunil Kumar",
"license": "ISC",
"devDependencies": {
"lite-server": "^2.3.0"
},
"dependencies": {
"materialize-css": "^0.100.2",
"node-sass": "^4.7.2"
}
}
I just want to change the colour of my app from its default colour to blue. So I have created theme.scss file and using node-sass module trying to generate CSS file. Here is my theme.scss
$primary-color: color("blue", "lighten-2") !default;
@import "../node_modules/materialize-css/sass/materialize";
but this is showing
{
"status": 1,
"file": "D:/SK/Study/MaterializeCSSDemo/node_modules/materialize-css/sass/components/_variables.scss",
"line": 39,
"column": 23,
"message": "argument `$color` of `lighten($color, $amount)` must be a colornnBacktrace:ntnode_modules/materialize-css/sass/components/_variables.scss:39, in function `lighten`ntnode_modules/materialize-css/sass/components/_variables.scss:39",
"formatted": "Error: argument `$color` of `lighten($color, $amount)` must be a colornn Backtrace:n tnode_modules/materialize-css/sass/components/_variables.scss:39, in function `lighten`n tnode_modules/materialize-css/sass/components/_variables.scss:39n on line 39 of node_modules/materialize-css/sass/components/_variables.scssn>> $primary-color-light: lighten($primary-color, 15%) !default;n ----------------------^n"
}
is there any simple and clean way to make modifications to the theme? On the documentation page, it is saying by changing the _variables.scss file directely.
css node.js materialize
add a comment |
I have created nodejs project. Here is package.json
{
"name": "materializecssdemo",
"version": "1.0.0",
"description": "Use of material design components",
"main": "index.js",
"scripts": {
"prestart": "node-sass ./scss/theme.scss ./css/materialize-theme.css",
"start": "lite-server",
"test": "echo "Error: no test specified" && exit 1"
},
"author": "Sunil Kumar",
"license": "ISC",
"devDependencies": {
"lite-server": "^2.3.0"
},
"dependencies": {
"materialize-css": "^0.100.2",
"node-sass": "^4.7.2"
}
}
I just want to change the colour of my app from its default colour to blue. So I have created theme.scss file and using node-sass module trying to generate CSS file. Here is my theme.scss
$primary-color: color("blue", "lighten-2") !default;
@import "../node_modules/materialize-css/sass/materialize";
but this is showing
{
"status": 1,
"file": "D:/SK/Study/MaterializeCSSDemo/node_modules/materialize-css/sass/components/_variables.scss",
"line": 39,
"column": 23,
"message": "argument `$color` of `lighten($color, $amount)` must be a colornnBacktrace:ntnode_modules/materialize-css/sass/components/_variables.scss:39, in function `lighten`ntnode_modules/materialize-css/sass/components/_variables.scss:39",
"formatted": "Error: argument `$color` of `lighten($color, $amount)` must be a colornn Backtrace:n tnode_modules/materialize-css/sass/components/_variables.scss:39, in function `lighten`n tnode_modules/materialize-css/sass/components/_variables.scss:39n on line 39 of node_modules/materialize-css/sass/components/_variables.scssn>> $primary-color-light: lighten($primary-color, 15%) !default;n ----------------------^n"
}
is there any simple and clean way to make modifications to the theme? On the documentation page, it is saying by changing the _variables.scss file directely.
css node.js materialize
I have created nodejs project. Here is package.json
{
"name": "materializecssdemo",
"version": "1.0.0",
"description": "Use of material design components",
"main": "index.js",
"scripts": {
"prestart": "node-sass ./scss/theme.scss ./css/materialize-theme.css",
"start": "lite-server",
"test": "echo "Error: no test specified" && exit 1"
},
"author": "Sunil Kumar",
"license": "ISC",
"devDependencies": {
"lite-server": "^2.3.0"
},
"dependencies": {
"materialize-css": "^0.100.2",
"node-sass": "^4.7.2"
}
}
I just want to change the colour of my app from its default colour to blue. So I have created theme.scss file and using node-sass module trying to generate CSS file. Here is my theme.scss
$primary-color: color("blue", "lighten-2") !default;
@import "../node_modules/materialize-css/sass/materialize";
but this is showing
{
"status": 1,
"file": "D:/SK/Study/MaterializeCSSDemo/node_modules/materialize-css/sass/components/_variables.scss",
"line": 39,
"column": 23,
"message": "argument `$color` of `lighten($color, $amount)` must be a colornnBacktrace:ntnode_modules/materialize-css/sass/components/_variables.scss:39, in function `lighten`ntnode_modules/materialize-css/sass/components/_variables.scss:39",
"formatted": "Error: argument `$color` of `lighten($color, $amount)` must be a colornn Backtrace:n tnode_modules/materialize-css/sass/components/_variables.scss:39, in function `lighten`n tnode_modules/materialize-css/sass/components/_variables.scss:39n on line 39 of node_modules/materialize-css/sass/components/_variables.scssn>> $primary-color-light: lighten($primary-color, 15%) !default;n ----------------------^n"
}
is there any simple and clean way to make modifications to the theme? On the documentation page, it is saying by changing the _variables.scss file directely.
css node.js materialize
css node.js materialize
asked Dec 26 '17 at 13:09
Sunil GargSunil Garg
4,59564980
4,59564980
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Try this
$primary-color: lighten(blue, 2) !default;
Args passed to function should be a color and number. Not a string.
And there is no color function in scss.
You can create color using other function like hsl or rgb.
Check full list of scss functions here
add a comment |
Materialize comes with a color palette based on the material design base colors.
I recommend you to use these to set theme colors, to follow the Material Design color system.
To be able to do so, you have to import the file which defines these colors first, then set your theme color variables, then import the rest of materialize files. Not sure about our npm setup, but in Rails with materialize-sass it works like this:
@import "materialize/components/color-variables";
$primary-color: color("blue", "lighten-2") !default;
$secondary-color: color("yellow", "base") !default;
@import 'materialize';
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f47979120%2fhow-to-change-color-theme-in-materializecss%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Try this
$primary-color: lighten(blue, 2) !default;
Args passed to function should be a color and number. Not a string.
And there is no color function in scss.
You can create color using other function like hsl or rgb.
Check full list of scss functions here
add a comment |
Try this
$primary-color: lighten(blue, 2) !default;
Args passed to function should be a color and number. Not a string.
And there is no color function in scss.
You can create color using other function like hsl or rgb.
Check full list of scss functions here
add a comment |
Try this
$primary-color: lighten(blue, 2) !default;
Args passed to function should be a color and number. Not a string.
And there is no color function in scss.
You can create color using other function like hsl or rgb.
Check full list of scss functions here
Try this
$primary-color: lighten(blue, 2) !default;
Args passed to function should be a color and number. Not a string.
And there is no color function in scss.
You can create color using other function like hsl or rgb.
Check full list of scss functions here
edited Dec 26 '17 at 13:58
answered Dec 26 '17 at 13:53
Artem BozhkoArtem Bozhko
48646
48646
add a comment |
add a comment |
Materialize comes with a color palette based on the material design base colors.
I recommend you to use these to set theme colors, to follow the Material Design color system.
To be able to do so, you have to import the file which defines these colors first, then set your theme color variables, then import the rest of materialize files. Not sure about our npm setup, but in Rails with materialize-sass it works like this:
@import "materialize/components/color-variables";
$primary-color: color("blue", "lighten-2") !default;
$secondary-color: color("yellow", "base") !default;
@import 'materialize';
add a comment |
Materialize comes with a color palette based on the material design base colors.
I recommend you to use these to set theme colors, to follow the Material Design color system.
To be able to do so, you have to import the file which defines these colors first, then set your theme color variables, then import the rest of materialize files. Not sure about our npm setup, but in Rails with materialize-sass it works like this:
@import "materialize/components/color-variables";
$primary-color: color("blue", "lighten-2") !default;
$secondary-color: color("yellow", "base") !default;
@import 'materialize';
add a comment |
Materialize comes with a color palette based on the material design base colors.
I recommend you to use these to set theme colors, to follow the Material Design color system.
To be able to do so, you have to import the file which defines these colors first, then set your theme color variables, then import the rest of materialize files. Not sure about our npm setup, but in Rails with materialize-sass it works like this:
@import "materialize/components/color-variables";
$primary-color: color("blue", "lighten-2") !default;
$secondary-color: color("yellow", "base") !default;
@import 'materialize';
Materialize comes with a color palette based on the material design base colors.
I recommend you to use these to set theme colors, to follow the Material Design color system.
To be able to do so, you have to import the file which defines these colors first, then set your theme color variables, then import the rest of materialize files. Not sure about our npm setup, but in Rails with materialize-sass it works like this:
@import "materialize/components/color-variables";
$primary-color: color("blue", "lighten-2") !default;
$secondary-color: color("yellow", "base") !default;
@import 'materialize';
answered Jan 4 at 17:14
thuttthutt
13911
13911
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f47979120%2fhow-to-change-color-theme-in-materializecss%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown