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;
}







1















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.










share|improve this question





























    1















    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.










    share|improve this question

























      1












      1








      1








      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.










      share|improve this question














      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 26 '17 at 13:09









      Sunil GargSunil Garg

      4,59564980




      4,59564980
























          2 Answers
          2






          active

          oldest

          votes


















          1














          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






          share|improve this answer

































            0














            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';





            share|improve this answer
























              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
              });


              }
              });














              draft saved

              draft discarded


















              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









              1














              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






              share|improve this answer






























                1














                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






                share|improve this answer




























                  1












                  1








                  1







                  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






                  share|improve this answer















                  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







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Dec 26 '17 at 13:58

























                  answered Dec 26 '17 at 13:53









                  Artem BozhkoArtem Bozhko

                  48646




                  48646

























                      0














                      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';





                      share|improve this answer




























                        0














                        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';





                        share|improve this answer


























                          0












                          0








                          0







                          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';





                          share|improve this answer













                          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';






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Jan 4 at 17:14









                          thuttthutt

                          13911




                          13911






























                              draft saved

                              draft discarded




















































                              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.




                              draft saved


                              draft discarded














                              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





















































                              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







                              Popular posts from this blog

                              Monofisismo

                              Angular Downloading a file using contenturl with Basic Authentication

                              Olmecas