File tree Expand file tree Collapse file tree 5 files changed +60
-21
lines changed
js/react/lib/components/badge Expand file tree Collapse file tree 5 files changed +60
-21
lines changed Original file line number Diff line number Diff line change @@ -20,13 +20,12 @@ export const Badge = withAs(
2020 < Component
2121 { ...rest }
2222 className = { cn ( [
23- "text-paragraph-2 flex w-fit items-center gap-1 rounded-full border-[0.8px] border-black px-2 " ,
23+ "text-paragraph-2 rustlanges-badge " ,
2424 BADGE_VARIANTS [ variant ] ,
2525 BADGE_TYPE [ type ] ,
26- "desktop:text-[12px] text-[10px]" ,
2726 ] ) }
2827 >
29- < div className = "size-1 rounded-full " />
28+ < div className = "rustlanges-badge__dot " />
3029 < span > { displayValue ( ) } </ span >
3130 </ Component >
3231 ) ;
Original file line number Diff line number Diff line change 11export const BADGE_VARIANTS = {
2- completed : [
3- "bg-success-100 text-success-600 [&>div]:bg-success-600" ,
4- "dark:bg-success-950 dark:text-success-400 [&>div]:bg-success-600" ,
5- ] ,
6- reading : [
7- "bg-warning-100 text-warning-500 [&>div]:bg-warning-500" ,
8- "dark:bg-warning-950 dark:text-warning-300 [&>div]:bg-warning-300" ,
9- ] ,
10- pending : [
11- "bg-error-100 text-error-600 [&>div]:bg-error-600" ,
12- "dark:bg-error-950 dark:text-error-300 [&>div]:bg-error-300" ,
13- ] ,
14- unread : [
15- "bg-neutral-100 text-neutral-500 [&>div]:bg-neutral-500" ,
16- "dark:bg-neutral-950 dark:text-neutral-300 [&>div]:bg-neutral-300" ,
17- ] ,
2+ completed : "rustlanges-badge--variant-completed" ,
3+ reading : "rustlanges-badge--variant-reading" ,
4+ pending : "rustlanges-badge--variant-pending" ,
5+ unread : "rustlanges-badge--variant-unread" ,
186} ;
197
208export const BADGE_TYPE = {
21- default : "[&>span]:hidden size-4 px-0! justify-center " ,
22- numeric : "flex-row-reverse " ,
9+ default : "rustlanges-badge--type-default " ,
10+ numeric : "rustlanges-badge--type-numeric " ,
2311 text : undefined ,
2412} ;
2513
Original file line number Diff line number Diff line change 11@import "./components/avatar.css" ;
2+ @import "./components/badge.css" ;
23@import "./components/text.css" ;
Original file line number Diff line number Diff line change 1+ @layer components {
2+ .rustlanges-badge {
3+ @apply flex w-fit items-center gap-1 rounded-full border-[0.8px ] border-black px-2;
4+
5+ font-size : 10px ;
6+ @variant desktop {
7+ font-size : 12px ;
8+ }
9+ }
10+
11+ .rustlanges-badge__dot {
12+ @apply size-1 rounded-full;
13+ }
14+
15+ .rustlanges-badge--type-default {
16+ @apply px-0! size-4 justify-center [& > span]: hidden;
17+ }
18+
19+ .rustlanges-badge--type-numeric {
20+ @apply flex-row-reverse;
21+ }
22+
23+ .rustlanges-badge--variant-completed {
24+ @apply bg-success-100 text-success-600 [& > div]: bg- success-600 ;
25+ @variant dark {
26+ @apply bg-success-950 text-success-400 [& > div]: bg- success-600 ;
27+ }
28+ }
29+
30+ .rustlanges-badge--variant-reading {
31+ @apply bg-warning-100 text-warning-500 [& > div]: bg- warning-500 ;
32+ @variant dark {
33+ @apply bg-warning-950 text-warning-300 [& > div]: bg- warning-300 ;
34+ }
35+ }
36+
37+ .rustlanges-badge--variant-pending {
38+ @apply bg-error-100 text-error-600 [& > div]: bg- error -600 ;
39+ @variant dark {
40+ @apply bg-error-950 text-error-300 [& > div]: bg- error -300 ;
41+ }
42+ }
43+
44+ .rustlanges-badge--variant-unread {
45+ @apply bg-neutral-100 text-neutral-500 [& > div]: bg- neutral-500 ;
46+ @variant dark {
47+ @apply bg-neutral-950 text-neutral-300 [& > div]: bg- neutral-300 ;
48+ }
49+ }
50+ }
Original file line number Diff line number Diff line change 9191 font-weight : 600 ;
9292 line-height : 160% ;
9393 letter-spacing : 0.28% ;
94+
9495 @apply desktop:text-[16px ];
9596 }
9697
You can’t perform that action at this time.
0 commit comments