Alerts
Basic dismissable and non-dismissable alerts container style utilities.
Examples (anchor)
The alert styles can be customized before compiling using Sass or in real-time with CSS variables.
Default (anchor)
Basic alert
Example HTML
<div class="alert">
<p>Basic alert</p>
</div>
<dialog class="alert" open>
<p>Dismissable alert!</p>
<form method="dialog">
<button><span>Close</span></button>
</form>
</dialog>Fixed light and dark (anchor)
Basic alert!
Basic alert!
Example HTML
<div class="alert alert-light">
<p>Basic alert!</p>
</div>
<dialog class="alert alert-light" open>
<p>Dismissable alert!</p>
<form method="dialog">
<button><span>Close</span></button>
</form>
</dialog>
<div class="alert alert-dark">
<p>Basic alert!</p>
</div>
<dialog class="alert alert-dark" open>
<p>Dismissable alert!</p>
<form method="dialog">
<button><span>Close</span></button>
</form>
</dialog>Using the module (anchor)
Load StyleMods as demonstrated (change file path as required) then include the Sass mixin anywhere below.
@use "stylemods/scss" as *;
@include alerts-css;See the using modules page for more information.
Using the framework (anchor)
Using the recommended custom setup enable the styles in an overrides document:
@use "stylemods/scss/configuration" as *;
$enable-alerts: true;Include the overrides and the framework styles with your custom document for compiling the framework:
@use "overrides";
@use "stylemods/scss/stylemods";See using the framework for more information.
Source code (anchor)
The Alerts source file is included with the components module files, you can view the source code from the latest release (v1.5.0) via the Github link below.
- Source document
- stylemods/scss/components/alerts.scss
- View on Github
- https://github.com/pmbrown/StyleMods/blob/main/scss/components/alerts.scss
Shared documentation about how to customize the default property values for the styles using the Sass and CSS variables is provided on the customizing page.