Fan Card
Sections are split:
Main Icon Styling
You can style the main icon like this:
Change the icon type/mdi.
card_mod:
style: |
ha-state-icon {
--card-mod-icon: mdi:mushroom;
}
Change the icon color.
card_mod:
style: |
ha-state-icon {
color: orange;
}
Change icon size.
card_mod:
style: |
ha-state-icon {
--icon-symbol-size: 40px;
}
Rotate Icon.
card_mod:
style: |
ha-state-icon {
rotate: 30deg;
}
Offset/Pad Icon.
This one there is a couple different ones you can use, and also some different value types. i would just play around with it until you find what you like.
card_mod:
style: |
ha-state-icon {
padding-right: 30px;
padding-left: 10px;
padding-bottom: -20px;
height: 20px;
width: 50px;
}
Animate the Icon.
If you are using an animation you need to put your keyframes outside of the ha-state-icon, like the below.
for this card you can also just turn on spin animation for when the fan is on via the visual editor.
card_mod:
style: |
ha-state-icon {
animation: wobbling 0.7s linear infinite alternate;
}
@keyframes wobbling {
0% {transform: rotate(-80deg);}
100% {transform: rotate(40deg);}
}
End Icon Styling Section
Main Icon Background/Shape Styling
You can style the main icon background/shape like this:
Shape Color.
card_mod:
style:
mushroom-shape-icon$: |
.shape {
--shape-color: orange !important;
}
Shape Size.
You should set the icon size to 21px as this is the standard size for mushroom cards. you are then free to change the size of the shape without affecting the icon.
card_mod:
style:
mushroom-shape-icon$: |
.shape {
--icon-symbol-size: 21px;
--icon-size: 100px;
}
Shape Shadow.
Left with shadow, right standard without shadow. !important seems to be required.
card_mod:
style:
mushroom-shape-icon$: |
.shape {
box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.36) !important;
}
Shape “Shape”?
Note that it doesnt seem like you can use negative values here.
card_mod:
style:
mushroom-shape-icon$: |
.shape {
padding-right: 40px;
padding-left: 10px;
padding-bottom: 10px;
}
Shape Outline/Border.
the different border types can be found here.
card_mod:
style:
mushroom-shape-icon$: |
.shape {
border: 2.5px outset green
}
Shape Animation.
If you are using an animation you need to put your keyframes outside of the .shape, like the below.
card_mod:
style:
mushroom-shape-icon$: |
.shape {
--shape-animation: ping 2s infinite;
}
@keyframes ping {
0% {box-shadow: 0 0 0 0 rgba(var(--rgb-red), 0.7);}
70% {box-shadow: 0 0 0 10px transparent;}
100% {box-shadow: 0 0 0 0 transparent;}
}
End Shape/Icon Background Styling Section
Card Styling
The card body itself can be styled like this:
Background Color.
Note that any buttons and sliders also seem to change color according to this color. you can style the buttons seperately which you will see later in the guide.
card_mod:
style: |
ha-card {
background-color: #002f7a;
}
Background outline/border.
Note that setting a border size does seem to change the actual card size slightly. border types can be found here.
card_mod:
style: |
ha-card {
border: 2.5px outset blue
}
Card shadow.
You can use this to both add a shadow and remove one if your theme has a shadow by default like mine does (minimalist).
Add Shadow.
card_mod:
style: |
ha-card {
box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.66);
}
Remove Shadow.
card_mod:
style: |
ha-card {
box-shadow: none;
}
Card size.
This changes the outside size of the card. not any of the interior contents. you have to use !important it seems for height to actually change.
card_mod:
style: |
ha-card {
height: 200px !important;
width: 200px;
}
Card padding.
This adds interior padding to the card and therefore squishes the internals into the dimensions of the card more. the interior items will get smaller. you have to use !important it seems for padding to take effect.
card_mod:
style: |
ha-card {
padding-right: 150px !important;
padding-left: 150px !important;
padding-bottom: 30px !important;
padding-top: 30px !important;
}
Card margins.
Card margin adds blank space to the outside of the card squeezing the entire card (interiror and exterior) into a smaller space, making the whole card smaller.
card_mod:
style: |
ha-card {
margin-top: 30px;
margin-bottom: 30px;
margin-left: 30px;
margin-right: 30px;
}
Card Border/Corner Radius.
Changes the radius of the corners. this is set to 0. so sharp corners.
card_mod:
style: |
ha-card {
border-radius: 0px;
}
Card Shape Animation
card_mod:
style: |
ha-card {
border-radius: 20px !important;
animation: ping 2s infinite;
}
@keyframes ping {
0% {box-shadow: 0 0 0 0 rgba(var(--rgb-red), 0.7);}
70% {box-shadow: 0 0 0 10px transparent;}
100% {box-shadow: 0 0 0 0 transparent;}
}
End of Card Styling Section
Text Styling
Primary (or first line) text can be styled like this:
Change Font.
maybe dont use Wingdings
card_mod:
style: |
ha-card {
font-family: "Wingdings 2";
}
Change Font Style.
Font styles can be found here.
card_mod:
style: |
ha-card {
font-style: italic;
}
Change Font Variant.
Font variants can be found here.
card_mod:
style: |
ha-card {
font-variant: small-caps;
}
Change Font Size.
I have not found a way to change font size for text across the board. you have to do them individually it seems.
card_mod:
style:
mushroom-state-info$: |
.container {
--card-secondary-font-size: 20px;
--card-primary-font-size: 20px;
}
Change Font Color.
I have not found a way to change color for text accross the board. you have to do them individually it seems.
card_mod:
style:
mushroom-state-info$: |
.container {
--card-primary-color: blue;
--card-secondary-color: orange;
}
Change Alligment
Different allignment options can be found here.
card_mod:
style:
mushroom-state-info$: |
.container {
align-items: end;
}
Change Rows.
Gap will need to be adjusted depending on your primary text length. you can find the different types of flex direction here. yaml courtesy of @zanixmechanix
card_mod:
style:
mushroom-state-info$: |
.container {
flex-direction: row !important;
align-items: baseline;
gap: 10px;
}
End of Text Styling Section
Selection Value Styling
N/A Fan Card has no Selection Value.
End of Selection Value Styling Section
Badge Icon Styling
N/A Fan Card has no Badge Icon.
End of Badge Icon Styling Section
Badge Icon Background/Shape Styling
N/A Fan Card has no Badge Icon.
End of Badge Icon Shape Styling Section
Slider Styling
If you have sliders they can be controlled like this:
Change color.
card_mod:
style:
mushroom-fan-percentage-control$: |
mushroom-slider {
--main-color: teal !important;
--bg-color: #d1eced !important;
}
Change Size
There isnt enough space to make the slider any bigger so if that is your aim i would recommend making the box that they live in bigger as well. like the below. of course this doesnt apply if you are making the buttons smaller. !important is required.
card_mod:
style:
mushroom-fan-percentage-control$:
mushroom-slider$: |
.slider {
width: 200px !important;
height: 200px !important;
}
.: |
mushroom-fan-percentage-control {
height: 200px;
}
Rotate slider
I would not recommend using this. the control doesnt follow the direction of the slider. it is just a bad idea.
card_mod:
style:
mushroom-fan-percentage-control$:
mushroom-slider$: |
.slider {
rotate: 90deg;
}
.: |
mushroom-fan-percentage-control {
height: 200px;
}
Offset/Pad Slider
You have to use margin instead of padding. padding only seems to make the slider itself bigger.
card_mod:
style:
mushroom-fan-percentage-control$:
mushroom-slider$: |
.slider {
margin-right: 100px;
margin-top: 30px !important;
}
.: |
mushroom-fan-percentage-control {
height: 74px;
}
Animate Slider Shape.
i would recommend adding some padding so that the animation has the space to show. you need to put your keyframes outside of the .slider, like the below.
card_mod:
style:
mushroom-fan-percentage-control$:
mushroom-slider$: |
.slider {
animation: ping 2s infinite;
}
@keyframes ping {
0% {box-shadow: 0 0 0 0 rgba(var(--rgb-red), 0.7);}
70% {box-shadow: 0 0 0 10px transparent;}
100% {box-shadow: 0 0 0 0 transparent;}
}
.: |
mushroom-fan-percentage-control {
padding: 10px;
height: 40px;
}
Slider Border.
Maybe add some padding the the box the slider lives in.
card_mod:
style:
mushroom-fan-percentage-control$:
mushroom-slider$: |
.slider {
border: dashed blue !important;
}
End of Slider Styling Section
Buttons Styling
If you have control buttons they can be styled like this:
Change the icon type/mdi.
card_mod:
style:
mushroom-fan-oscillate-control$:
mushroom-button:nth-child(1)$: |
.button ::slotted(*) {
--card-mod-icon: mdi:mushroom;
}
Change the icon color.
card_mod:
style:
mushroom-fan-oscillate-control$:
mushroom-button:nth-child(1)$: |
.button ::slotted(*) {
--card-mod-icon-color: orange;
}
Change icon size.
card_mod:
style:
mushroom-fan-oscillate-control$:
mushroom-button:nth-child(1)$: |
.button ::slotted(*) {
--control-icon-size: 50px;
}
Rotate Icon.
card_mod:
style:
mushroom-fan-oscillate-control$:
mushroom-button:nth-child(1)$: |
.button ::slotted(*) {
rotate: 40deg;
}
Offset/Pad Icon.
card_mod:
style:
mushroom-fan-oscillate-control$:
mushroom-button:nth-child(1)$: |
.button ::slotted(*) {
padding-right: 100px;
padding-left: 10px;
padding-bottom: 20px;
width: 150px;
}
Animate the Icon.
you will need to put your keyframes outside of the ha-icon as per the below.
card_mod:
style:
mushroom-fan-oscillate-control$:
mushroom-button:nth-child(1)$: |
.button ::slotted(*) {
animation: wobbling 0.7s linear infinite alternate;
}
@keyframes wobbling {
0% {transform: rotate(-80deg);}
100% {transform: rotate(40deg);}
}
Button Background.
!important seems to be required.
card_mod:
style:
mushroom-fan-oscillate-control$:
mushroom-button:nth-child(1)$: |
.button {
background: #780000 !important;
}
Button Size.
There isnt enough space to make the button any bigger so if that is your aim i would recommend making the boxes that they live in bigger as well. like the below. of course this doesnt apply if you are making the buttons smaller.
card_mod:
style:
mushroom-fan-oscillate-control$:
mushroom-button:nth-child(1)$: |
.button {
height: 100px !important;
width: 100px !important;
}
.: |
mushroom-fan-oscillate-control {
height: 100px !important;
width: 100px !important;
}
Button Location.
Only margin top and left work, but negative values are allowed so you can move them anywhere you please. you can add extra space like the below by making the boxes that the buttons live in bigger if you need it.
card_mod:
style:
mushroom-fan-oscillate-control$:
mushroom-button:nth-child(1)$: |
.button {
margin-top: 20px !important;
margin-left: 37px !important;
}
.: |
mushroom-fan-oscillate-control {
height: 100px !important;
width: 100px !important;
}
Button Border/Outline.
border types can be found here.
card_mod:
style:
mushroom-fan-oscillate-control$:
mushroom-button:nth-child(1)$: |
.button {
border: dashed blue !important;
}
Button Reverse Order.
N/A only 1 button for the fan card.
Animate buttons shape.
i would recommend adding some padding to the boxes that the buttons live in just so that there is space for the animation. you will need to put your keyframes outside of the .button, like the below.
card_mod:
style:
mushroom-fan-oscillate-control$:
mushroom-button:nth-child(1)$: |
.button {
animation: ping 2s infinite;
}
@keyframes ping {
0% {box-shadow: 0 0 0 0 rgba(var(--rgb-red), 0.7);}
70% {box-shadow: 0 0 0 10px transparent;}
100% {box-shadow: 0 0 0 0 transparent;}
}
.: |
mushroom-fan-oscillate-control {
padding: 10px;
height: 40px;
}
End of Buttons Styling Section
End of Fan Card Section
Humidifier Card
Sections are split:
Main Icon Styling
You can style the main icon like this:
Change the icon type/mdi.
card_mod:
style: |
ha-state-icon {
--card-mod-icon: mdi:mushroom;
}
Change the icon color.
card_mod:
style: |
ha-state-icon {
color: orange;
}
Change icon size.
card_mod:
style: |
ha-state-icon {
--icon-symbol-size: 40px;
}
Rotate Icon.
card_mod:
style: |
ha-state-icon {
rotate: 30deg;
}
Offset/Pad Icon.
This one there is a couple different ones you can use, and also some different value types. i would just play around with it until you find what you like.
card_mod:
style: |
ha-state-icon {
padding-right: 30px;
padding-left: 10px;
padding-bottom: -20px;
height: 20px;
width: 50px;
}
Animate the Icon.
If you are using an animation you need to put your keyframes outside of the ha-state-icon, like the below.
for this card you can also just turn on spin animation for when the fan is on via the visual editor.
card_mod:
style: |
ha-state-icon {
animation: wobbling 0.7s linear infinite alternate;
}
@keyframes wobbling {
0% {transform: rotate(-80deg);}
100% {transform: rotate(40deg);}
}
End Icon Styling Section
Main Icon Background/Shape Styling
You can style the main icon background/shape like this:
Shape Color.
card_mod:
style:
mushroom-shape-icon$: |
.shape {
--shape-color: orange !important;
}
Shape Size.
You should set the icon size to 21px as this is the standard size for mushroom cards. you are then free to change the size of the shape without affecting the icon.
card_mod:
style:
mushroom-shape-icon$: |
.shape {
--icon-symbol-size: 21px;
--icon-size: 100px;
}
Shape Shadow.
Left with shadow, right standard without shadow. !important seems to be required.
card_mod:
style:
mushroom-shape-icon$: |
.shape {
box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.36) !important;
}
Shape “Shape”?
Note that it doesnt seem like you can use negative values here.
card_mod:
style:
mushroom-shape-icon$: |
.shape {
padding-right: 40px;
padding-left: 10px;
padding-bottom: 10px;
}
Shape Outline/Border.
the different border types can be found here.
card_mod:
style:
mushroom-shape-icon$: |
.shape {
border: 2.5px outset green
}
Shape Animation.
If you are using an animation you need to put your keyframes outside of the .shape, like the below.
card_mod:
style:
mushroom-shape-icon$: |
.shape {
--shape-animation: ping 2s infinite;
}
@keyframes ping {
0% {box-shadow: 0 0 0 0 rgba(var(--rgb-red), 0.7);}
70% {box-shadow: 0 0 0 10px transparent;}
100% {box-shadow: 0 0 0 0 transparent;}
}
End Shape/Icon Background Styling Section
Card Styling
The card body itself can be styled like this:
Background Color.
Note that any buttons and sliders also seem to change color according to this color. you can style the slider seperately which you will see later in the guide.
card_mod:
style: |
ha-card {
background-color: #002f7a;
}
Background outline/border.
Note that setting a border size does seem to change the actual card size slightly. border types can be found here.
card_mod:
style: |
ha-card {
border: 2.5px outset blue
}
Card shadow.
You can use this to both add a shadow and remove one if your theme has a shadow by default like mine does (minimalist).
Add Shadow.
card_mod:
style: |
ha-card {
box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.66);
}
Remove Shadow.
card_mod:
style: |
ha-card {
box-shadow: none;
}
Card size.
This changes the outside size of the card. not any of the interior contents. you have to use !important it seems for height to actually change.
card_mod:
style: |
ha-card {
height: 200px !important;
width: 200px;
}
Card padding.
This adds interior padding to the card and therefore squishes the internals into the dimensions of the card more. the interior items will get smaller. you have to use !important it seems for padding to take effect.
card_mod:
style: |
ha-card {
padding-right: 150px !important;
padding-left: 150px !important;
padding-bottom: 30px !important;
padding-top: 30px !important;
}
Card margins.
Card margin adds blank space to the outside of the card squeezing the entire card (interiror and exterior) into a smaller space, making the whole card smaller.
card_mod:
style: |
ha-card {
margin-top: 30px;
margin-bottom: 30px;
margin-left: 30px;
margin-right: 30px;
}
Card Border/Corner Radius.
Changes the radius of the corners. this is set to 0. so sharp corners.
card_mod:
style: |
ha-card {
border-radius: 0px;
}
Card Shape Animation
card_mod:
style: |
ha-card {
border-radius: 20px !important;
animation: ping 2s infinite;
}
@keyframes ping {
0% {box-shadow: 0 0 0 0 rgba(var(--rgb-red), 0.7);}
70% {box-shadow: 0 0 0 10px transparent;}
100% {box-shadow: 0 0 0 0 transparent;}
}
End of Card Styling Section
Text Styling
Primary (or first line) text can be styled like this:
Change Font.
maybe dont use Wingdings
card_mod:
style: |
ha-card {
font-family: "Wingdings 2";
}
Change Font Style.
Font styles can be found here.
card_mod:
style: |
ha-card {
font-style: italic;
}
Change Font Variant.
Font variants can be found here.
card_mod:
style: |
ha-card {
font-variant: small-caps;
}
Change Font Size.
I have not found a way to change font size for text across the board. you have to do them individually it seems.
card_mod:
style:
mushroom-state-info$: |
.container {
--card-secondary-font-size: 20px;
--card-primary-font-size: 20px;
}
Change Font Color.
I have not found a way to change color for text accross the board. you have to do them individually it seems.
card_mod:
style:
mushroom-state-info$: |
.container {
--card-primary-color: blue;
--card-secondary-color: orange;
}
Change Alligment
Different allignment options can be found here.
card_mod:
style:
mushroom-state-info$: |
.container {
align-items: end;
}
Change Rows.
Gap will need to be adjusted depending on your primary text length. you can find the different types of flex direction here. yaml courtesy of @zanixmechanix
card_mod:
style:
mushroom-state-info$: |
.container {
flex-direction: row !important;
align-items: baseline;
gap: 10px;
}
End of Text Styling Section
Selection Value Styling
N/A Humidifier Card has no Selection Value.
End of Selection Value Styling Section
Badge Icon Styling
N/A Humidifier Card has no Badge Icon.
End of Badge Icon Styling Section
Badge Icon Background/Shape Styling
N/A Humidifier Card has no Badge Icon.
End of Badge Icon Shape Styling Section
Slider Styling
If you have sliders they can be controlled like this:
Change color.
card_mod:
style:
mushroom-humidifier-humidity-control$: |
mushroom-slider {
--main-color: teal !important;
--bg-color: #d1eced !important;
}
Change Size
There isnt enough space to make the slider any bigger so if that is your aim i would recommend making the box that they live in bigger as well. like the below. of course this doesnt apply if you are making the buttons smaller. !important is required.
card_mod:
style:
mushroom-fan-percentage-control$:
mushroom-slider$: |
.slider {
width: 200px !important;
height: 200px !important;
}
.: |
mushroom-fan-percentage-control {
height: 200px;
}
Rotate slider
I would not recommend using this. the control doesnt follow the direction of the slider. it is just a bad idea.
card_mod:
style:
mushroom-fan-percentage-control$:
mushroom-slider$: |
.slider {
rotate: 90deg;
}
.: |
mushroom-fan-percentage-control {
height: 200px;
}
Offset/Pad Slider
You have to use margin instead of padding. padding only seems to make the slider itself bigger.
card_mod:
style:
mushroom-fan-percentage-control$:
mushroom-slider$: |
.slider {
margin-right: 100px;
margin-top: 30px !important;
}
.: |
mushroom-fan-percentage-control {
height: 74px;
}
Animate Slider Shape.
i would recommend adding some padding so that the animation has the space to show. you need to put your keyframes outside of the .slider, like the below.
card_mod:
style:
mushroom-fan-percentage-control$:
mushroom-slider$: |
.slider {
animation: ping 2s infinite;
}
@keyframes ping {
0% {box-shadow: 0 0 0 0 rgba(var(--rgb-red), 0.7);}
70% {box-shadow: 0 0 0 10px transparent;}
100% {box-shadow: 0 0 0 0 transparent;}
}
.: |
mushroom-fan-percentage-control {
padding: 10px;
height: 40px;
}
Slider Border.
Maybe add some padding the the box the slider lives in.
card_mod:
style:
mushroom-fan-percentage-control$:
mushroom-slider$: |
.slider {
border: dashed blue !important;
}
End of Slider Styling Section
Buttons Styling
N/A Humidifier Card does not have control buttons.
End of Buttons Styling Section
End of Humidifier Card Section