custom-cards / button-card

❇️ Lovelace button-card for home assistant
MIT License
1.93k stars 233 forks source link

margin: none still visible after 2022.11 release #632

Open silviudc opened 1 year ago

silviudc commented 1 year ago

Checklist

Describe the bug Formatting seems to be wrong after 2022.11 and the new rounded “icons” image

When drawing two cards on top of each other - I usually put some timer or other data in the overlaid one only while that device is on.

Version of the card Version: 3.4.2 To Reproduce This is the configuration I used:

type: custom:button-card
      entity: sensor.washer_power
      state_display: '[[[ return Math.round(entity.state) + " W" ]]]'
      margin: none
      show_name: false
      show_icon: false
      show_state: true
      styles:
        card:
          - box-shadow: none
          - font-size: 12px
        state:
          - color: |
              [[[
                if (states['sensor.washer_power'].state > 2)
                  return "red";
                else
                  return "white";
              ]]]

Screenshots If applicable, add screenshots to help explain your problem. See above

Expected behavior A clear and concise description of what you expected to happen. The border/margin of the custom card should not visible, as it was in pre-2022.11

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

bowlokus commented 1 year ago

I have same problem after 2022.11

white lines

Captura de tela 2022-11-09 21 25 06

      - type: custom:decluttering-card
        template: switch_button_card
        variables:
          - entity: light.luz_porta
          - name: Porta
          - icon: wall-sconce-round
          - aspect_ratio: 1/1
          - show_label: false
          - margin-right: 40px
          - hold_action:
              action: none
          - double_tap_action:
              action: none

all aplications and browsers

troinine commented 1 year ago

As a workaround, assuming you don't want the borders visible in 2022.11.x you can globally disable those in the theme as discussed in the HA forum:

ha-card-border-width: 0

Ref to tested workaround: https://github.com/troinine/hass-config/commit/c194bb54a470f6c1749532b8444780507bae24d3

Or alternatively, you can set it only to your button-card by defining it in the card style:

  styles:
    card:
      - border-width: 0
Dim3333 commented 1 year ago

Hi,

I set

  styles:
    card:
      - border-width: 0

but no effect.

My card:

  - type: custom:button-card
    color: '#D1DBAE'
    name: Salon
    styles:
      card:
        - background-color: '#EE2E2'
        - height: 25px
        - border-width: 0
      name:
        - font-size: 20px
  - entity: input_select.chauffage
    name: Mode
  - type: conditional
    conditions:
      - entity: input_select.chauffage
        state: Manuel
    row:
      entity: input_number.consigne_salon
      type: custom:numberbox-card
      name: Réglage consigne
  - type: custom:hui-element
    card_type: glance
    show_name: false
    style: |
      ha-card {
        background: var(--background-card-color);
        box-shadow: none;
        font-size: 18px;
        top: -10px;
        margin: -20px
      }
    entities:
      - entity: sensor.thgr810_thgn800_e9_0a_temperature
        icon: mdi:cloud
      - entity: input_number.consigne_salon
        icon: mdi:target
      - entity: input_number.puissance_radiateur_salon
        icon: mdi:lightning-bolt
      - entity: switch.pilot_wire_4
        icon: mdi:radiator
      - entity: sensor.daily_chauffage_salon_round
        icon: mdi:calendar-today
  - type: divider
  - type: custom:scheduler-card
    standard_configuration: false
    discover_existing: false
    include:
      - input_number
    time_step: 15
    tags: Salon
    show_add_button: false
    title: ''
    display_options:
      primary_info:
        - '{action}'
      secondary_info: relative-time
  - type: divider
  - type: custom:mini-graph-card
    entities:
      - entity: sensor.thgn122_123_thgn132_thgr122_228_238_268_fa_02_temperature
        unit: °C
        color: '#df6366'
        show_legend: false
    show:
      icon: false
      name: false
      labels: true
      extrema: true
    hours_to_show: 24
    line_width: 1
    points_per_hour: 12

image

bowlokus commented 1 year ago

Hi,

I set

  styles:
    card:
      - border-width: 0

but no effect.

My card:

  - type: custom:button-card
    color: '#D1DBAE'
    name: Salon
    styles:
      card:
        - background-color: '#EE2E2'
        - height: 25px
        - border-width: 0
      name:
        - font-size: 20px
  - entity: input_select.chauffage
    name: Mode
  - type: conditional
    conditions:
      - entity: input_select.chauffage
        state: Manuel
    row:
      entity: input_number.consigne_salon
      type: custom:numberbox-card
      name: Réglage consigne
  - type: custom:hui-element
    card_type: glance
    show_name: false
    style: |
      ha-card {
        background: var(--background-card-color);
        box-shadow: none;
        font-size: 18px;
        top: -10px;
        margin: -20px
      }
    entities:
      - entity: sensor.thgr810_thgn800_e9_0a_temperature
        icon: mdi:cloud
      - entity: input_number.consigne_salon
        icon: mdi:target
      - entity: input_number.puissance_radiateur_salon
        icon: mdi:lightning-bolt
      - entity: switch.pilot_wire_4
        icon: mdi:radiator
      - entity: sensor.daily_chauffage_salon_round
        icon: mdi:calendar-today
  - type: divider
  - type: custom:scheduler-card
    standard_configuration: false
    discover_existing: false
    include:
      - input_number
    time_step: 15
    tags: Salon
    show_add_button: false
    title: ''
    display_options:
      primary_info:
        - '{action}'
      secondary_info: relative-time
  - type: divider
  - type: custom:mini-graph-card
    entities:
      - entity: sensor.thgn122_123_thgn132_thgr122_228_238_268_fa_02_temperature
        unit: °C
        color: '#df6366'
        show_legend: false
    show:
      icon: false
      name: false
      labels: true
      extrema: true
    hours_to_show: 24
    line_width: 1
    points_per_hour: 12

image

TRY

styles: card:

or, for another buttons or spaces

style: | ha-card { border: 0px; }

Dim3333 commented 1 year ago

Hi,

I tried but without effects ....

`type: entities entities:

image

bowlokus commented 1 year ago

Hi,

I tried but without effects ....

`type: entities entities:

  • type: custom:button-card color: '#D1DBAE' name: Salon styles: card:
    • background-color: '#EE2E2'
    • height: 25px
    • border-width: 0
    • border: 0
    • ha-card-border-width: 0 name:
    • font-size: 20px
  • entity: input_select.chauffage name: Mode
  • type: conditional conditions:

    • entity: input_select.chauffage state: Manuel row: entity: input_number.consigne_salon type: custom:numberbox-card name: Réglage consigne
  • type: custom:hui-element card_type: glance show_name: false style: | ha-card { background: var(--background-card-color); box-shadow: none; font-size: 18px; top: -10px; border: 0px; margin: -20px } entities:

    • entity: sensor.thgr810_thgn800_e9_0a_temperature icon: mdi:cloud
    • entity: input_number.consigne_salon icon: mdi:target
    • entity: input_number.puissance_radiateur_salon icon: mdi:lightning-bolt
    • entity: switch.pilot_wire_4 icon: mdi:radiator
    • entity: sensor.daily_chauffage_salon_round icon: mdi:calendar-today
  • type: divider
  • type: custom:scheduler-card standard_configuration: false discover_existing: false include:

    • input_number time_step: 15 tags: Salon show_add_button: false title: '' display_options: primary_info:

    • '{action}' secondary_info: relative-time

  • type: divider
  • type: custom:mini-graph-card entities:

    • entity: sensor.thgn122_123_thgn132_thgr122_228_238_268_fa_02_temperature unit: °C color: '#df6366' show_legend: false show: icon: false name: false labels: true extrema: true hours_to_show: 24 line_width: 1 points_per_hour: 12 `

image

look my codes:

tomadas.yaml

type: vertical-stack cards: ###########################################################################################################################

COLUNA 001

###########################################################################################################################

coluna 01 -----------------------------------

decluttering_templates.yaml

Cartão de botão padrão (usado durante a maior parte da minha configuração)

switch_button_card: default:

CARTOES EM BRANCO

blank_button_card: default:

space_button_card: default:

Joao-Sousa-71 commented 1 year ago

As a workaround, assuming you don't want the borders visible in 2022.11.x you can globally disable those in the theme as discussed in the HA forum:

ha-card-border-width: 0

Ref to tested workaround: troinine/hass-config@c194bb5

Or alternatively, you can set it only to your button-card by defining it in the card style:

  styles:
    card:
      - border-width: 0

This worked for me! Thank you.