Closed tomdye closed 5 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.
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.
@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
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 { ... }
This will be incorporated into the material changes we are working on
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.