Skip to content
This repository has been archived by the owner on May 10, 2023. It is now read-only.

Commit

Permalink
chore: generalize box layout
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelKohler committed Feb 12, 2022
1 parent 61739c5 commit e35138f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
13 changes: 6 additions & 7 deletions web/css/root.css
Expand Up @@ -218,23 +218,22 @@ form button:not(.standalone) {
font-size: 0.7rem;
}

.success-box {
.box {
margin: 1.5rem 0;
padding: 1rem;
}

.box.success {
border: 2px solid var(--success-border-color);
background-color: var(--success-background-color);
}

.error-box {
margin: 1.5rem 0;
padding: 1rem;
.box.error {
border: 2px solid var(--error-border-color);
background-color: var(--error-background-color);
}

.warning-box {
margin: 1.5rem 0;
padding: 1rem;
.box.warning {
border: 2px solid var(--warning-border-color);
background-color: var(--warning-background-color);
}
Expand Down
4 changes: 2 additions & 2 deletions web/src/components/error.tsx
Expand Up @@ -10,13 +10,13 @@ export default function Error({ translationKey, children }: Props) {
if (translationKey) {
return (
<Localized id={translationKey}>
<div className="error-box"></div>
<div className="error box"></div>
</Localized>
);
}

if (children) {
return <div className="error-box">{children}</div>;
return <div className="error box">{children}</div>;
}

return null;
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/profile/settings.tsx
Expand Up @@ -67,7 +67,7 @@ export default function Settings() {
),
}}
>
<div className="warning-box"></div>
<div className="warning box"></div>
</Localized>
)}
</section>
Expand Down
6 changes: 3 additions & 3 deletions web/src/components/success.tsx
Expand Up @@ -12,21 +12,21 @@ export default function Success({ translationKey, vars, children }: Props) {
if (translationKey && !hasVars) {
return (
<Localized id={translationKey}>
<div className="success-box"></div>
<div className="success box"></div>
</Localized>
);
}

if (translationKey && hasVars) {
return (
<Localized id={translationKey} vars={vars}>
<div className="success-box"></div>
<div className="success box"></div>
</Localized>
);
}

if (children) {
return <div className="success-box">{children}</div>;
return <div className="success box">{children}</div>;
}

return null;
Expand Down

0 comments on commit e35138f

Please sign in to comment.