Skip to content

Commit

Permalink
update: extract css from Badge component (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurFlag authored May 13, 2024
1 parent a0d4205 commit 68be39a
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 25 deletions.
8 changes: 7 additions & 1 deletion src/components/Badges/EarlyBadge/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import React from 'react';
import clsx from 'clsx';
import styles from './styles.module.css';
import stylesGeneric from '../styles.module.css';

export default function EarlyBadge(): JSX.Element {
return <span className={styles.badge}>Early availabilty</span>;
return (
<span className={clsx(stylesGeneric.badge, styles.badge)}>
Early availabilty
</span>
);
}
7 changes: 0 additions & 7 deletions src/components/Badges/EarlyBadge/styles.module.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
.badge {
background-color: var(--aiven-orange-5);
border-radius: var(--badge-radius);
color: var(--aiven-grey-70);
font-weight: 400;
text-transform: uppercase;
margin: 0;
padding: 4px 8px;
font-size: 80%;
vertical-align: middle;
}

h1 .badge,
Expand Down
8 changes: 7 additions & 1 deletion src/components/Badges/LimitedBadge/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import React from 'react';
import clsx from 'clsx';
import styles from './styles.module.css';
import stylesGeneric from '../styles.module.css';

export default function LimitedBadge(): JSX.Element {
return <span className={styles.badge}>Limited availabilty</span>;
return (
<span className={clsx(stylesGeneric.badge, styles.badge)}>
Limited availabilty
</span>
);
}
7 changes: 0 additions & 7 deletions src/components/Badges/LimitedBadge/styles.module.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
.badge {
background-color: var(--aiven-primary-10);
border-radius: var(--badge-radius);
color: var(--aiven-grey-70);
font-weight: 400;
text-transform: uppercase;
margin: 0;
padding: 4px 8px;
font-size: 80%;
vertical-align: middle;
}

h1 .badge,
Expand Down
4 changes: 3 additions & 1 deletion src/components/Badges/ProBadge/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React from 'react';
import clsx from 'clsx';
import styles from './styles.module.css';
import stylesGeneric from '../styles.module.css';

export default function ProBadge(): JSX.Element {
return <span className={styles.badge}>pro</span>;
return <span className={clsx(stylesGeneric.badge, styles.badge)}>pro</span>;
}
8 changes: 0 additions & 8 deletions src/components/Badges/ProBadge/styles.module.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
.badge {
background-color: var(--aiven-primary-orange);
border-radius: var(--badge-radius);
color: white;
font-weight: 400;
text-transform: uppercase;
margin: 0;
padding: 4px 8px;
font-size: 80%;
vertical-align: middle;
}

h1 .badge,
Expand Down
15 changes: 15 additions & 0 deletions src/components/Badges/styles.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.badge {
border-radius: var(--badge-radius);
font-weight: 400;
text-transform: uppercase;
margin: 0;
padding: 4px 8px;
font-size: 80%;
vertical-align: middle;
}

h1 .badge,
h2 .badge,
h3 .badge {
font-size: 43%;
}

0 comments on commit 68be39a

Please sign in to comment.