#Some card_mod stuff

1 messages Β· Page 1 of 1 (latest)

upper sonnet
#

So, card mod is a bit tricker than just adding some settings like you did. It does modify the CSS but each card may be a little bit different. This example I'm about to post actually came from when I was card_modding a Markdown card. Turns out, in this case, most of it works for the entities card.

#

This is more than what you asked for but I think it turned out pretty cool so I'm posting the whole thing: ```yaml
type: entities
entities:

  • light.living_room_lights
    card_mod:
    style: |
    ha-markdown {
    padding: 0 0 0 1 !important;
    font-size: 12px !important;
    font-weight: normal !important;
    line-height: 1.4 !important;
    }
    ha-card {
    font-family: Arial;
    text-align: center;
    width: 350px;
    box-shadow: 0px 2px 5px 1px red;
    border-radius: 25px;
    {% if is_state('light.living_room_lights', 'on') %}
    background-color: yellow;
    color: black;
    box-shadow: inset 0px 0px 5px 1px black;
    {% else %}
    background: transparent;
    color: yellow;
    box-shadow: inset 0px 0px 5px 1px yellow;
    {% endif %}
    } ```
#

@limber elbow Here's some more fun stuff for you to check out.

limber elbow
#

oooooh

#

me likey

#

guess who's not watching movies tonite

severe skiff
#

im using the badge cards along with the the custom badge cards from hacs, this how it currently looks ( see image 1 with the red cards), what im trying to do is increase the size of the person card at the top, without increasing the size of the others but when i add width:100px height 100px using the browser dev tool inspector to style it how i wanted to have it in this case ( .label-badge ) it increases the size of all the badge cards ( see image 2 ).
and no matter what i add into the raw config code it wont increase the size of the cards. 2 things i noticed that you have are
card_mod: but when i use this i get a error
** style: |** ive been using "styles" and im not sure what the | is used for.

upper sonnet
#

Just my two cents here. I've never really cared for the badges. They're cool and all but they just seem too limited in capabilities to be useful. I don't mean that in the sense of conveying information, but, moreso, being able to customize them such as how you're trying to do.
IMO, I think you would have better "display-ability" if you were to design a custom:button-card https://github.com/custom-cards/button-card to replicate the look of the badges. It might take some work but you'd ultimately have more control over how it looks, such as, being able to change the color of the rings around the icon, for example, could be useful.

severe skiff
#

ok, ill try remake it using the button card πŸ™‚

severe skiff
#

button card suck 😦 like most of the i community stuff its never just a straight forward install and use lol

limber elbow
#

they aren't that bad LOL

severe skiff
#

i installed it, followed the instructions and boom error, after error so more trouble shooting to do then will have another crack at it tomorrow

upper sonnet
#

I've been using button-cards for about three years. Was the first thing I installed via HACS. Never had any issues with it.

limber elbow
#

yeah I've installed it on a few HA boxes of mine

#

never had issues either

upper sonnet
#

In fact, my dashboards are probably 85% custom:buttons-cards. (at least the visible stuff; not counting layout-related cards)

limber elbow
#

I only have a bunch on my testing dashboard

#

mostly because of you d πŸ˜›

upper sonnet
#

I had to break apart my testing views into two: one for custom:button-cards; one for Mushroom cards. Started another view for cards tha tI've helped people with; just had to start a second one of those. (I'm kind of a hoarder in that regards.)

severe skiff
#

i get Configuration errors detected: No type provided. then it says in the installation guide

add resources:
 - url: /hacsfiles/button-card/button-card.js
   type: module``

to the ui-lovelace.yaml which i can only assume is the dashboard raw configuration window but when i do that i get more errors πŸ˜‚

limber elbow
#

that's not right

#

it should in in configuation.yaml

#

and not "add resources" just resources:

#

actually

#

I didn't even have to do that

#

it just worked

upper sonnet
#

Are you not able to install via HACS? (Waaay easier...)

limber elbow
#

I only had to add card-mod

severe skiff
#

i tried putting it in the config.yaml and i get a error saying Integration error: resources - Integration 'resources' not found. i did install using hacs

upper sonnet
#

You shouldn't have to do both; one or the other.

severe skiff
#

i tried 1 way didn't work, so tried the other way and still didn't work. im uninstalling it now

upper sonnet
#

Did you have the add part of add resources:? I think it is supposed to be just resources:.

severe skiff
#

no i just put resource that add above awas a typo πŸ™‚

upper sonnet
#

Go to Developer Tools > States > Check Configuration button and see if it spits back any errors.

#

Wait. Can you post a screenshot of the errors you're getting? You might just need to refresh and/or clear cache on your browser. (@limber elbow Why'd we forget the #1 troubleshooting step?)

severe skiff
#

ive uninstalled it and refreshing ha atm. will try re-installing again through hacs

limber elbow
severe skiff
#

reinstalled it, put it into the configuration.yaml went to dev tools > check config > error

upper sonnet
#

I don't think I ever put the resources into a ui-lovelace.yaml. I don't even know where that goes...

severe skiff
upper sonnet
#

Take out lines 26-29 from the first screenshot. I don't think that is needed. Then, try Developer Tools, States, Restart, Quick Reload. Refresh browser and/or clear caches.

severe skiff
#

so i took it out, checked config and then it was fine, restarted and cleared cache, tryped using 1 of the example buttons

upper sonnet
#

Yeah. I think that it old stuff. Tinkerer made a comment:
In your configuration folder if you’re using YAML mode.

Most folks won’t be, so you’ll use the raw UI config editor.

#
type: custom:button-card
entity: switch.ac```
limber elbow
#

remove the -

#

dammit d already beat me to it

upper sonnet
#

😎

limber elbow
#

im configuring a layout for buttons for the new point of sale at the shop

#

so I'm doing buttons at work and buttons in my spare time, FML

upper sonnet
#

But yeah, the - comes into play for other things but, in this case, not used.

#

Life is just full of buttons.

severe skiff
#

yay sucess πŸ˜„

#

kind of haha

#

thanks for the support, and the patience πŸ™‚ now i can back it up and start trying to crack the styling tomorrow lol

upper sonnet
#

There's a lot that it can to. Just a matter of tinkering with it to get it to work the way you want. Soon, you'll be incorporating JavaScript and card_mod to do even more. πŸ˜‰ (speaking from experience)

severe skiff
#

ive only had ha since friday last week so quite new to it and yaml, adding js to the buttons will come later on πŸ˜›

limber elbow
#

and then you'll end up with a test box at work and 2 test boxes at home

#

and your production box

#

and experimental shit on all of them

severe skiff
#

a test system for the test system

limber elbow
#

exactly