Skip to content

fix: allow ColorGenerator to parse colors with prefix # #5669

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

Merged
merged 1 commit into from
Oct 9, 2021

Conversation

Andrewnt219
Copy link
Contributor

@Andrewnt219 Andrewnt219 commented Oct 8, 2021

Motivation

Fixes #5665

Currently, the color generator at Styling Your File With Infima doesn't handle input string with the prefix #. More than often, users copy colors from design apps, dev tools or config files with a prefix # in them.

Therefore, I removed any leading # so Color won't throw when there is a prefix #.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

Inside preview, go to Guides > Styling and Layout > Styling Your File With Infima. Enter these values for Primary color:

ccc -> table should update with new colors.
#abc -> table should update with new colors.
##cba -> table should update with new colors.

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

@netlify
Copy link

netlify bot commented Oct 8, 2021

✔️ [V2]
Built without sensitive environment variables

🔨 Explore the source changes: ebbdf46

🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/6160806b7a673b000778c112

😎 Browse the preview: https://deploy-preview-5669--docusaurus-2.netlify.app

@github-actions
Copy link

github-actions bot commented Oct 8, 2021

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟢 Performance 96
🟢 Accessibility 98
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 95

Lighthouse ran on https://deploy-preview-5669--docusaurus-2.netlify.app/

@lex111 lex111 added the pr: maintenance This PR does not produce any behavior differences to end users when upgrading. label Oct 9, 2021
@lex111 lex111 merged commit 6636210 into facebook:main Oct 9, 2021
@lex111
Copy link
Contributor

lex111 commented Oct 9, 2021

@Andrewnt219 works fine, thanks!

@Andrewnt219
Copy link
Contributor Author

Hi @lex111, I'll be really happy if you also add "hacktoberfest-accepted" label to the PR 😄.

@lex111
Copy link
Contributor

lex111 commented Oct 9, 2021

It's not really necessary, this label is already added to the repository, so every PR counts in HF.

@Andrewnt219
Copy link
Contributor Author

@lex111, ah that's right. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: maintenance This PR does not produce any behavior differences to end users when upgrading.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐞Bug: The color generator doesn't work when an input string starts with #
2 participants