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

Creating "Classes" of Look and Feel Widgets #271

Closed
kitsonk opened this issue Aug 11, 2017 · 1 comment
Closed

Creating "Classes" of Look and Feel Widgets #271

kitsonk opened this issue Aug 11, 2017 · 1 comment
Assignees
Milestone

Comments

@kitsonk
Copy link
Member

kitsonk commented Aug 11, 2017

User Story

As a developer, I need to create re-usable classes of widgets, where I am not changing the functional behaviour of the widget, but having a different visual style from one class to another within an application.

Specific Use Case

I am using @dojo/widgets/Slider. I am using a custom theme. My design indicates that one class of sliders should have a standard slider as the background, where as another class should have a linear triangle as the background to give a visual indication of volume level, versus position in the slider.

@kitsonk kitsonk added this to the 2017.08 milestone Aug 11, 2017
@kitsonk kitsonk added the beta3 label Aug 11, 2017
@kitsonk kitsonk modified the milestones: 2017.08, 2017.09 Sep 4, 2017
@eheasley eheasley added beta4 and removed beta3 labels Oct 3, 2017
@eheasley eheasley modified the milestones: 2017.09, 2017.10 Oct 6, 2017
@bitpshr
Copy link
Member

bitpshr commented Oct 20, 2017

This is directly related to the solution posed by @smhigley at #270, despite that issue title being specific to instance styling. If a downstream application uses stylistic variations of a Slider, ultra-minimal extensions of a Slider can be made for each necessary variation that use different @theme decorators. The decorators would point to CSS that contains only a ruleset to override the slider background as necessary:

// Custom-themed Slider
@theme(standardSliderCss)
export class StandardSlider extends Slider { }

// Variation of the default Slider, could have also extended Slider
// directly and used stacked themes
@theme(volumeSliderCss)
export class VolumeSlider extends StandardSlider { }

An escape hatch of extending the Slider and overriding its helper method that returns root classes is also possible (#316).

Action items:

@bitpshr bitpshr closed this as completed Oct 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants