Shadows

Four basic box shadow styles available as utility classes and CSS variables.

Examples

Small
Default
Large
Extra large
Examples HTML
<div class="shadow-sm">Small</div>
<div class="shadow">Default</div>
<div class="shadow-lg">Large</div>
<div class="shadow-xl">Extra large</div>

Using the module

Add the sassmods.scss to your custom styles as below, use the Sass variables from the module's source code (see below) to customize the default property values if required, then include the Sass mixin anywhere below.

@use "sassmods/scss/sassmods" as *;
$shadow: 0 0.5rem 0.75rem rgba(0, 0, 0, 0.15); // example

@include shadows-css;

Using the framework

Enable the module in the sassmods-system.scss document as below, if required customize the styles or the Sass variables for the default property values directly in the source code (see below).

$enable-shadows: true;

Source

The source code is a self-contained Sass document that compiles the style modules as Sass mixins using Sass variables provided for the core property values that can be customized as described above.

_shadows.scss

Use the property specific CSS variables to create root level variables for global styles and/or editing inline, or change all the values to suit your own parameters.

// ---------------------------------------------------------- 
// Shadows
// ----------------------------------------------------------
$shadow:      0 0.25rem 0.75rem rgba(0, 0, 0, 0.15) !default;
$shadow-sm:   0 0.125rem 0.25rem rgba(0, 0, 0, 0.1) !default;
$shadow-lg:   0 0.5rem 1.25rem rgba(0, 0, 0, 0.15) !default;
$shadow-xl:   0 1rem 2.5rem rgba(0, 0, 0, 0.175) !default;

@mixin shadows-css {

:where(html) {
  --shadow: #{$shadow};
  --shadow-sm: #{$shadow-sm};
  --shadow-lg: #{$shadow-lg};
  --shadow-xl: #{$shadow-xl};
}

.shadow {
  box-shadow: var(--shadow);
}
  
.shadow-sm {
  box-shadow: var(--shadow-sm);
}
  
.shadow-lg {
  box-shadow: var(--shadow-lg);
}
  
.shadow-xl {
  box-shadow: var(--shadow-xl);
}

} // end shadows-css