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

Scalable UI #156 #187

Merged
merged 3 commits into from
Nov 27, 2019
Merged

Scalable UI #156 #187

merged 3 commits into from
Nov 27, 2019

Conversation

kalkih
Copy link
Owner

@kalkih kalkih commented Nov 13, 2019

Adds a new theme variable to adjust the scale of the card UI, this affects most of the cards elements and dimensions.

New theme variable is: --mini-media-player-scale and defaults to 40px.
The value is basically the row height, each row of the card is allowed to take up this much height and the UI is scaled accordingly.

This variable can be set either in the user's theme which will apply it to all mmp cards or with card-mod in the :host selector to target individual cards.

Screenshot 2019-11-13 at 18 54 27

# user-theme
mini-media-player-scale: 50px
# card-mod example
...card config
style: |
  :host {
    --mini-media-player-scale: 50px;
  }

Unsure if we should add this as a card option instead of as a theme variable, and if we should keep the value as pixels or change it to percentage, scale (e.g. 2, 2.5, 0.75) or any other unit, would appreciate feedback regarding this.

Closes #156

@kalkih kalkih added the enhancement New feature or request label Nov 13, 2019
@kalkih kalkih changed the base branch from master to dev November 13, 2019 17:57
@kalkih
Copy link
Owner Author

kalkih commented Nov 27, 2019

Added support for setting scale both through a config option and through theme variable.
Card option (if set) will override theme variable.

I also changed from a px value to a modifier value where default is 1 or "1.0".

# user theme variable
mini-media-player-scale: 1.25
# card-example
type: custom:mini-media-player
...options
scale: 0.75

@kalkih kalkih merged commit a54e765 into dev Nov 27, 2019
@kalkih kalkih deleted the scalable-ui branch January 4, 2021 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant