Skip to content

Commit

Permalink
#40 add custom text color for contribution (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
FabDonRixos authored Nov 26, 2024
2 parents 9697b53 + 7e81f3b commit f45caae
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default [
"import/order": [
"warn",
{
groups: ["builtin", "external", "internal", "parent", "sibling", "index", "unknown"],
groups: ["builtin", "external", "internal", ["parent", "sibling"], "index", "unknown"],
pathGroups: [
{
pattern: "**/*.scss",
Expand Down
2 changes: 2 additions & 0 deletions src/artworks/0_artworks-list/artworksList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface IArtworkItem {
gitHubName: string;
tags?: EArtworkTags[] | string[];
backgroundColor?: `#${string}`; // No transparent backgrounds
textColor?: `#${string}`;
full?: boolean; // Only use this if you really have no other but to claim more space.
oneLink?: ILink;
editedAt?: Date;
Expand All @@ -27,6 +28,7 @@ const artworksList: IArtworkItem[] = [
gitHubName: "FabDonRixos",
tags: [EArtworkTags.SIMPLE],
backgroundColor: "#000000",
textColor: "#ffffff",
full: true,
oneLink: {
name: "fabian.li",
Expand Down
10 changes: 7 additions & 3 deletions src/website/artwork/Artwork.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@ export default function Artwork({ artwork }: ArtWrapperProps): ReactElement {
<div
className={`${style.component} ${artwork.full ? `${style.full}` : undefined}`}
style={
artwork.backgroundColor && artwork.backgroundColor.length <= 7
? ({ "--background-color": artwork.backgroundColor } as CSSProperties)
: ({ "--background-color": "#000000" } as CSSProperties)
{
"--background-color":
artwork.backgroundColor && artwork.backgroundColor.length <= 7
? artwork.backgroundColor
: "#000000",
"--text-color": artwork.textColor && artwork.textColor.length <= 7 ? artwork.textColor : "#ffffff",
} as CSSProperties
}
>
<div className={style.content}>{artwork.component}</div>
Expand Down
7 changes: 4 additions & 3 deletions src/website/artwork/artwork.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
gap: 0.5rem;
border-top: #737373 1px solid;
background-color: rgba(255, 255, 255, 0.25);
color: var(--text-color);
backdrop-filter: blur(10px);
padding: 1rem;
width: 100%;
Expand All @@ -54,14 +55,14 @@
gap: 0.5rem;

& a {
color: white;
color: var(--text-color);
text-decoration: none;
border-bottom: 1px dotted white;
border-bottom: 1px dotted var(--text-color);
width: fit-content;

&:is(:hover, :focus) {
outline: none;
border-bottom: 1px solid white;
border-bottom: 1px solid var(--text-color);
}
}
}
Expand Down

0 comments on commit f45caae

Please sign in to comment.