Skip to content

Commit

Permalink
fix(ColorGenerator): always prepend entered colors with pound sign (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
averyjohnston authored Apr 12, 2023
1 parent 2dc8c1c commit 29a1279
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/page/theming/ColorGenerator/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const ColorGenerator = (props) => {
const { tint, shade, value } = color;
const nameCap = name[0].toUpperCase() + name.substring(1);

const formattedValue = value.charAt(0) === '#' ? value : '#' + value;
const isOpen = activeColor === name ? true : false;

return (
Expand All @@ -52,13 +53,13 @@ const ColorGenerator = (props) => {
>
<div className={styles.titleRow}>
<div className={styles.titleRowStart}>
<ColorDot color={value} />
<ColorDot color={formattedValue} />
{nameCap}
</div>
<div className={styles.titleRowEnd}>
<ColorInput
onClick={(ev) => ev.stopPropagation()}
color={value}
color={formattedValue}
setColor={(color) =>
setColors((colors) => {
colors[name] = generateColor(color);
Expand Down

1 comment on commit 29a1279

@vercel
Copy link

@vercel vercel bot commented on 29a1279 Apr 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

ionic-docs – ./

ionic-docs-gqykycf8t.vercel.app
ionic-docs-git-main-ionic1.vercel.app
ionic-docs-ionic1.vercel.app

Please sign in to comment.