dojo / widgets

:rocket: Dojo - UI widgets.
https://widgets.dojo.io
Other
89 stars 65 forks source link

Should consider adding primary / success / info etc modes / flags to Button #462

Closed tomdye closed 5 years ago

tomdye commented 6 years ago

Enhancement

The dojo 1.x flat theme added primary / success / info etc.. modes to the Button widget. We should add these flags to Button which in turn add extra styling / theming classes to button to enable further styling / customisation.

screenshot 2018-02-02 15 41 34

smhigley commented 6 years ago

I think this actually falls under what we said would need extension to achieve (I actually believe this exact example was used in the issue). I don't think it's a great idea to add to Button properties to create those specific styles since they come from our theme, not from any functionality inherent to buttons.

We can definitely create an extended Button for the examples page or showcase page to demonstrate that the theme contains the classes, though.

tomdye commented 6 years ago

I see what you're saying here, but I also feel that providing such ability to create a primary or similar button simply via the use of a property will make it much easier for adopters to get up and running without having to learn the complexities of extending a basic widget etc... further more, it could be a repeated mode throughout our widget set, allowing the select / combo box drop downs to utilise the same mode / colouring for different uses.

smhigley commented 6 years ago

@tomdye I definitely see the utility of making it easy to style multiple button skins, although I still think it would be better in the long run to think about how to either make it easier for users to do this themselves. At any rate, I think this can wait until post-rc, and switch to the discussion tag

schontz commented 6 years ago

Would it be possible to tie this into the theme? For example, Icon allows type based upon the CSS classes in its theme file. Can we do the same for buttons? If you extend with your own theme that adds classes with a certain prefix (type-?) then they can be used for the type? Then you could have:

.type-success { ... }
.type-warn { ... }
.type-info { ... }
tomdye commented 5 years ago

This will be incorporated into the material changes we are working on