Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#40 add custom text color for contribution #41

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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