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

Set initial color #4

Open
desandro opened this issue Nov 20, 2016 · 1 comment
Open

Set initial color #4

desandro opened this issue Nov 20, 2016 · 1 comment

Comments

@desandro
Copy link
Member

Vote for your preferred method to set initial color by adding a πŸ˜† , πŸŽ‰ , or ❀️ reaction for the corresponding solution

Do not add "+1" comment β€” they will be deleted. Subscribe for issue notifications using the button in the sidebar.


You can set initial color with <input> elements by setting their value

<input value="#C25" />

But there's no standard way to set initial color for non-inputs.

πŸ˜† Add initialColor option.

new Huebee( elem, {
  initialColor: '#C25',
}
<button data-huebee='{ "initialColor": "#C25" }'>Set color</button>

πŸŽ‰ Read initial color from text

<button>#C25</button>

❀️ Read initial color from style=" background-color: ..." attribute

<button style="background-color: #C25">#C25</button>
@lukewhitehouse
Copy link

πŸ˜†

The JS options approach will provide more flexibility and keep reliance away from the markup as much as possible, IMO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants