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

[Button] Revealing labeled icon button #6624

Open
GammaGames opened this issue Oct 15, 2018 · 0 comments
Open

[Button] Revealing labeled icon button #6624

GammaGames opened this issue Oct 15, 2018 · 0 comments

Comments

@GammaGames
Copy link
Contributor

GammaGames commented Oct 15, 2018

Revealing labeled icon button

I think the ability to have an icon button with an animated label that shows on hover would be a nice feature. I'm not sure if there's a more robust way to do it using js, but I did get an example working with just css:
peek 2018-10-15 14-51
The html looks like:

<a class="ui revealing green labeled icon button">
  <i class="check icon"></i> 
  <span class="label">
     Save
  </span>  
</a>

The css looks like:

.ui.revealing.labeled.icon.button {
  -webkit-transition: padding 0.4s ease-in-out;
  transition: padding 0.4s ease-in-out;
  padding-left: 2.57142857em !important;
  padding-right: 0 !important;
}

.ui.revealing.labeled.icon.button:hover {
  padding-left: 4.07142857em !important;
  padding-right: 1.5em !important;
}

.ui.revealing.button>.label {
  white-space: nowrap;
  -webkit-transition: max-width 0.4s ease-in-out;
  transition: max-width 0.4s ease-in-out;
  overflow: hidden;
  max-width: 0;
}

.ui.revealing.button:hover>.label {
  max-width: 10em;
}

A max-width of 10em is reasonable for my examples since I won't have any sentence length button labels.

Example

https://jsfiddle.net/ro2sbwkt/

@GammaGames GammaGames changed the title [Button] Revealing labeled icon button (feature request) [Button] Revealing labeled icon button Oct 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants