Skip to content

Commit

Permalink
Alerts fix (#177)
Browse files Browse the repository at this point in the history
This PR fixes an issue with alerts where rails usage and defaults conflicted with our naming conventions.
  • Loading branch information
Jeremy-Walton authored Jun 7, 2023
1 parent 05f0585 commit 5b58ada
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/components/alert.scss
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@
}
}

.alert-danger {
// alert-alert is an alias for alert-danger. See Alert.mdx for reasoning.
.alert-danger,
.alert-alert {
@extend %alert-global;

background-color: var(--op-color-alerts-danger-plus-eight);
Expand Down
2 changes: 2 additions & 0 deletions src/stories/Components/Alert/Alert.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ Alert can be used as a standalone component, however, it does have a few depende

`.alert-danger` Provides a danger styled message

`.alert-alert` is an alias for `.alert-danger`. Since RoleModel commonly uses [Rails](https://rubyonrails.org/) to develop projects, adding this alias allows this to be used for flash messages without having to change the default in rails. [Devise](https://github.com/heartcombo/devise) is also commonly used and cannot easily be configured away from this.

<Canvas of={AlertStories.Danger} />

### Info
Expand Down

0 comments on commit 5b58ada

Please sign in to comment.