Skip to content

feat(DNA): Add customizable color props to DNA loader#189

Merged
mhnpd merged 2 commits intomhnpd:masterfrom
Signor1:fix-dna-colors
Aug 31, 2025
Merged

feat(DNA): Add customizable color props to DNA loader#189
mhnpd merged 2 commits intomhnpd:masterfrom
Signor1:fix-dna-colors

Conversation

@Signor1
Copy link
Copy Markdown
Contributor

@Signor1 Signor1 commented Jun 29, 2025

Summary

This pull request resolves issue #156 by adding the ability to customize the colors of the DNA loader component directly via props. Previously, the colors were hardcoded, forcing users to rely on CSS overrides.

Changes

  • Introduced dnaColorOne and dnaColorTwo props: The DNA component now accepts two optional string props to set the colors of the DNA strands.
  • Dynamic Animation Colors: To ensure the animation looks great with any color, this PR adds the tinycolor2 library. It dynamically generates the intermediate frame of the color animation, preserving the original aesthetic (one color brightens, the other fades).
  • Removed Hardcoded Colors: All hardcoded fill colors in the SVG have been replaced with the new props.
  • Added New Dependency: tinycolor2 is now a dependency.

How to Use

The new props make customization simple and declarative.

Before:

// No way to change colors without CSS
<DNA />

Now:

<DNA
  dnaColorOne="#3056D3" // A custom blue
  dnaColorTwo="#E52727" // A custom red
/>

@Signor1 Signor1 mentioned this pull request Jun 29, 2025
@mhnpd
Copy link
Copy Markdown
Owner

mhnpd commented Aug 28, 2025

@Signor1 Please resolve the conflict.

@Signor1
Copy link
Copy Markdown
Contributor Author

Signor1 commented Aug 28, 2025

Alright @mhnpd

@mhnpd mhnpd merged commit b84d827 into mhnpd:master Aug 31, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants