mdgriffith / style-elements

Create styles that don't mysteriously break!
http://package.elm-lang.org/packages/mdgriffith/style-elements/latest
BSD 3-Clause "New" or "Revised" License
445 stars 49 forks source link

I can't find `title` attribute in version 4.0 #84

Open AionDev opened 7 years ago

AionDev commented 7 years ago

title attribute is nowhere to be found in version 4.0.

Was this intentional or an oversight?

For now, I can use attribute "title" "shows on hover.." - maybe not as nice.

I argue title should be included because is fairly common, and I can misspell attribute "tile" "shows on hover.." and then no errors will show up. Thank you :)

mdgriffith commented 7 years ago

I removed a lot of stuff that was inherited from the html library because I want to make sure that things that are included in the style elements lib are designed deliberately instead of just inheriting from html.

title could be a good candidate to be added back in though, can you give a brief explanation on the situations you use it in?

jxxcarlson commented 7 years ago

Yes, here is a typical example:

In module Views.Basic:

faIcon title icon attrs = el NavBarActive ([ height (px 25), width (px 20), title title, alignBottom, verticalCenter ] ++ attrs) (iconWhite20 icon)

I use this function extensively to pace icons in my app, e.g.,

randomDocumentIcon : Model -> Element Styles variation Msg randomDocumentIcon model = Basic.faIcon "Get random documents" FontAwesome.random [ onClick RandomDocuments ]

This displays the FontAwesome.random icon as an active element that when clicked displays a list of random documents. When the user hovers over the icon, the the text “Get random documents” is displayed. Because of the way the style NavBarActive is defined, the icon “blinks” when clicked.

BTW, the above shows why Elm + Style-Elements is all one needs to make “Components.”

— Jim

On Sep 18, 2017, at 8:20 AM, Matthew Griffith notifications@github.com wrote:

I removed a lot of stuff that was inherited from the html library because I want to make sure that things that are included in the style elements lib are designed deliberately instead of just inheriting from html.

title could be a good candidate to be added back in though, can you give a brief explanation on the situations you use it in?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mdgriffith/style-elements/issues/84#issuecomment-330202809, or mute the thread https://github.com/notifications/unsubscribe-auth/AApgN3IQdxwKzqVaXIohC_Ib3gZv5Auoks5sjmAXgaJpZM4Parkb.

AionDev commented 7 years ago

yep! same here, i'm using title to explain icons: i use title to explain what icons do

It's annoying to hover over something and not understand what is suppose to do. That icon is for showing the computation pipeline in my debugger.

cmditch commented 7 years ago

Agreed. title would be nice to have.

@mdgriffith thanks btw, loving the library so far. So much more pleasant than dealing with CSS.

mdgriffith commented 7 years ago

OK, so what I'm hearing is that what we really want is someway to conveniently create a tooltip :)

If I added a way to specify tooltips to the lib (els that are shown when you hover on the tagged box), would that handle the basic usecase that people are using title for?

jxxcarlson commented 7 years ago

That is what I was using it for.

On Sep 21, 2017, at 7:54 AM, Matthew Griffith notifications@github.com wrote:

OK, so what I'm hearing is that what we really want is someway to conveniently create a tooltip :)

If I added a way to specify tooltips to the lib (els that are shown when you hover on the tagged box), would that handle the basic usecase that people are using title for?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mdgriffith/style-elements/issues/84#issuecomment-331134360, or mute the thread https://github.com/notifications/unsubscribe-auth/AApgNzXaNRrg2xGdTkUdBXH-ekZ46KZ7ks5skk6KgaJpZM4Parkb.

AionDev commented 7 years ago

tooltip in github

If we would easily create something like this would be so much better. Title is pretty bad design compared with this 😄

kuon commented 6 years ago

Yeah I agree that proper tooltip would be nice, but it should also handle title for accessibility.

jesse-c commented 6 years ago

Titles are also used for accessibility. [1] If a custom tooltip implementation was added, those users may still be missing out.

[1] https://www.w3.org/WAI/tutorials/forms/labels/