Skip to content

[EuiIcon] Add sun glyph#5548

Merged
elizabetdev merged 4 commits intoelastic:mainfrom
elizabetdev:add-sun-icon
Jan 20, 2022
Merged

[EuiIcon] Add sun glyph#5548
elizabetdev merged 4 commits intoelastic:mainfrom
elizabetdev:add-sun-icon

Conversation

@elizabetdev
Copy link
Contributor

@elizabetdev elizabetdev commented Jan 19, 2022

Summary

This PR adds a sun glyph to EuiIcon.

The idea of the sun is to be used to toggle dark and light modes, so I focused on making the icon look similar to the moon icon. That's the reason the icon is filled and not linear.

The ray of the sun could have 1px to fit the grid. But this would make the icon not being centered and look smaller when compared with the moon. So I ended up with rays of 1.5px.

In case there's an animation to toggle from a moon to sun the animation would look better. Both icons will have the same center and similar weight.

Here are some tests: https://codesandbox.io/s/eager-field-i8r8q?file=/demo.js

Design

Screenshot 2022-01-19 at 19 17 35

Dark and light themes

My computer is using the macOS Monterey. I no longer have the option to open the browser in low res. So I'm using the following app http://easyresapp.com/ to test in low res. Hopefully, the tests correspond to reality.

preview-light-dark-before@2x

Checklist

  • Check against all themes for compatibility in both light and dark modes
  • Checked in mobile
  • Checked in Chrome, Safari, Edge, and Firefox
  • Props have proper autodocs and playground toggles
  • Added documentation
  • Checked Code Sandbox works for any docs examples
  • Added or updated jest and cypress tests
  • Checked for breaking changes and labeled appropriately
  • Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5548/

Copy link
Contributor

@cchaos cchaos left a comment

Choose a reason for hiding this comment

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

😻 Love it. I think the 1.5 stroke was the right choice. Lines don't always have to be crisp unless the blurriness loses the shape. But here it actually helps. Here's a screenshot from my firefox, seems similar to yours:
Screen Shot 2022-01-19 at 15 43 36 PM

And thanks for the codesandbox! Pretty cool to see it in action.

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5548/

@elizabetdev elizabetdev merged commit 955a99a into elastic:main Jan 20, 2022
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.

3 participants