Skip to content

Commit

Permalink
fix(frontend): dry alert styles
Browse files Browse the repository at this point in the history
  • Loading branch information
c0rydoras committed Nov 25, 2024
1 parent a54adbe commit dcd7c7f
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 15 deletions.
5 changes: 1 addition & 4 deletions frontend/app/components/alert.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
<div
class="rounded border border-[color-mix(in_srgb,currentColor_60%,transparent)] bg-[color-mix(in_srgb,currentColor_30%,transparent)] p-4"
...attributes
>
<div class="alert rounded border" ...attributes>
{{yield}}
</div>
2 changes: 1 addition & 1 deletion frontend/app/components/filter-sidebar/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<FaIcon @icon="sliders" @prefix="fas" />
{{#if @appliedCount}}
<span
class="filter-sidebar-toggle-icon-badge bg-success text-foreground-primary absolute right-2 top-2 rounded-[50%] px-1 py-0.5 font-mono text-xs shadow-sm duration-300"
class="filter-sidebar-toggle-icon-badge bg-success-light text-foreground-primary absolute right-2 top-2 rounded-[50%] px-1 py-0.5 font-mono text-xs shadow-sm duration-300"
>{{@appliedCount}}</span>
{{/if}}
</span>
Expand Down
4 changes: 2 additions & 2 deletions frontend/app/components/magic-link-modal/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@
data-test-magic-link-string
/>
{{#if this.statusMsg}}
<Alert class="text-success">
<Alert class="alert-success">
{{this.statusMsg}}
</Alert>
{{/if}}
{{#if this.errorMsg}}
<Alert class="text-danger">
<Alert class="alert-danger">
{{this.errorMsg}}
</Alert>
{{/if}}
Expand Down
16 changes: 10 additions & 6 deletions frontend/app/styles/components/alert.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
.ember-notify.alert-danger {
@apply bg-danger text-foreground-primary border-danger/80;
.alert {
@apply rounded p-4;
}

.ember-notify.alert-info {
@apply bg-primary text-foreground-primary border-primary/80;
.alert-danger {
@apply bg-danger-light text-foreground-primary !border-danger/80;
}

.ember-notify.alert-success {
@apply bg-success text-foreground-primary border-success/80;
.alert-info {
@apply bg-primary text-foreground-primary !border-primary/80;
}

.alert-success {
@apply bg-success-light text-foreground-primary !border-success/80;
}
3 changes: 2 additions & 1 deletion frontend/config/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,9 @@ module.exports = {
},
plugins: [forms()],
safelist: [
{ pattern: /noUi-/ },
{ pattern: /alert-/ },
{ pattern: /ember-/ },
{ pattern: /noUi-/ },
{ pattern: /shepherd-/ },
"invalid-feedback",
],
Expand Down
2 changes: 1 addition & 1 deletion frontend/pnpm-lock.yaml

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

0 comments on commit dcd7c7f

Please sign in to comment.