Skip to main content

Theme

  • This is the documentation of the most important core module to be used in the library.

SCSS/CSS

SCSS config() API

  • This is where all the theming happens in the library. The system takes the colors you've provided and automatically generates variants, as well as its appropriate text color for the components to consume.
PropertyEffect
$primary[REQUIRED]. The primary color of the theme. This usually is your main brand color.
$secondary[REQUIRED]. The secondary color of the theme. This color must be in stark contrast from the primary color as this will be used in call-to-action components such as the button, as well as to components that will catch the audiences' attention.
@include Theme.config(
#464646,
#7ed957
);

CSS custom properties API

  • You can use these properties to override certain theme aspects of a component, may it be a global theme property or a component-specific theme property.
  • This is also what the compiled CSS outputs from the Theme.config() mixin and uses to apply theme values to components.
PropertyEffect
--sph-theme--primaryThe theme's primary default variant.
--sph-theme--primary-darkThe theme's primary dark variant.
--sph-theme--primary-lightThe theme's primary light variant.
--sph-theme--secondaryThe theme's secondary default variant.
--sph-theme--secondary-darkThe theme's secondary dark variant.
--sph-theme--secondary-lightThe theme's secondary light variant.
--sph-theme--on-primaryThe theme's primary text color value.
--sph-theme--on-secondaryThe theme's secondary text color value.
:root {
--sph-theme--primary-light: #737373;
--sph-theme--primary: #474747;
--sph-theme--primary-dark: #1c1c1c;
--sph-theme--secondary-light: #b5e99f;
--sph-theme--secondary: #7ed957;
--sph-theme--secondary-dark: #51b128;
--sph-theme--on-primary: #fff;
--sph-theme--on-secondary: #000;
}