Colors
Svelte Materialify provides all the colors in the material design pallete at your disposal. You can access these colors either through css classes, scss or javascript. Each color gets its own You can also change the variant of the background color by adding the class: To change the variant of the text color by adding the class: You can also do the same for theme colors such as To add material colors in your own styles, just include the scss file. You can also import colors from the included utility in javascript if you wish to do so. Classes
text
and background
variant. You can use these classes in your application like <div class='red' />
for red background and <span class='red-text' />
. These colors are defined over here.{lighten|darken}-{n}
and change the accent by adding the class accent-{n}
text-{lighten|darken}-{n}
and change the accent by adding the class accent-{n}
primary-color
for background color and primary-text
for text color.<!-- backgrounds -->
<div class="red">Red</div>
<div class="yellow lighten-4">Light yellow</div>
<div class="deep-purple accent-1">Deep Purple</div>
<div class="primary-color">Primary</div>
<!-- text -->
<div class="red-text">Red</div>
<div class="yellow-text text-lighten-4">Light yellow</div>
<div class="deep-purple-text text-accent-1">Deep Purple</div>
<div class="primary-text">Primary</div>
Scss
@import 'svelte-materialify/src/styles/tools/colors';
h1 {
color: material-color('red', 'base');
background-color: material-color('green', 'lighten-5');
}
Javascript
import colors from 'svelte-materialify/src/utils/colors';
let red = colors.red.base;
let lightRed = colors.red['lighten-1'];
import { deepPurple } from 'svelte-materialify/src/utils/colors';
let purple = deepPurple.base;
Color Pack
red
pink
purple
deep-purple
indigo
blue
light-blue
cyan
teal
green
light-green
lime
yellow
amber
orange
deep-orange
brown
blue-grey
grey
shades