Last active
May 1, 2023 15:36
-
-
Save fireflysemantics/aec76cf92fb980b293a6989f98de425d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@use '@angular/material' as mat; | |
/// Defines a light color theme with success and danger colors. | |
/// @param {Map} $primary The primary color palette. | |
/// @param {Map} $accent The accent color palette. | |
/// @param {Map} $warn The warn color palette. | |
/// @param {Map} $success The success color palette. | |
/// @param {Map} $danger The danger color palette. | |
/// @param {Boolean} $create-light-theme If true a light theme is created, otherwise a dark theme is created | |
@function el-theme( | |
$primary, | |
$accent, | |
$warn: mat.$orange-palette, | |
$success: mat.$green-palette, | |
$danger: mat.$red-palette, | |
$create-light-theme: true | |
) { | |
$primary: mat.define-palette($primary); | |
$accent: mat.define-palette($accent); | |
$warn: mat.define-palette($warn); | |
$success: mat.define-palette($success); | |
$danger: mat.define-palette($danger); | |
$theme: null; | |
@if ($create-light-theme) { | |
$theme: mat.define-light-theme( | |
( | |
color: ( | |
primary: $primary, | |
accent: $accent, | |
warn: $warn, | |
), | |
) | |
); | |
} @else { | |
$theme: mat.define-dark-theme( | |
( | |
color: ( | |
primary: $primary, | |
accent: $accent, | |
warn: $warn, | |
), | |
) | |
); | |
} | |
$danger-success: ( | |
success: $success, | |
danger: $danger, | |
); | |
@return map-merge($theme, $danger-success); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment