Skip to content

Refactor cover controls into a separate component.#233

Merged
balloob merged 3 commits into
home-assistant:masterfrom
andrey-git:cover
Mar 7, 2017
Merged

Refactor cover controls into a separate component.#233
balloob merged 3 commits into
home-assistant:masterfrom
andrey-git:cover

Conversation

@andrey-git
Copy link
Copy Markdown
Contributor

Refactor cover controls into a separate component.

It will allow the new component to be used from custom components

@mention-bot
Copy link
Copy Markdown

@andrey-git, thanks for your PR! By analyzing the history of the files in this pull request, we identified @armills and @turbokongen to be potential reviewers.

Comment thread src/components/ha-cover-controls.html Outdated
<template>
<style>
.state {
text-align: right;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be part of state-card-cover.html as it's about how the component should be rendered.

Comment thread src/components/ha-cover-controls.html Outdated
.state {
text-align: right;
white-space: nowrap;
width: 127px;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually both of those are not needed at all. Removing.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure, our cards can be pretty wide if you have only 1 column. In that case the controls should be right aligned which I don't think they are now.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The controls are right aligned because state-card-cover has class='horizontal justified layout'.

width:127px does nothing because the "natural" width of the 3 buttons is 126.5px. When some buttons are unsupported they are visibility: hidden so width is not changed.

If the state container were wider, for example 226.px then text-align: right; would affect to which side of the 226.5px the 3 buttons are aligned. Since the container tightly wraps the buttons - text-align: right; has no effect.

@balloob balloob merged commit bdbeb1c into home-assistant:master Mar 7, 2017
@bramkragten bramkragten mentioned this pull request Jan 29, 2020
tkdrob pushed a commit to tkdrob/frontend that referenced this pull request Apr 20, 2021
…home-assistant#233)

Bumps @docusaurus/preset-classic from 2.0.0-alpha.55 to 2.0.0-alpha.56.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants