Here all my posts which may be useful:
NOTE:
Do not forget to add a "card_mod:"
keyword before "style:"
(new in card-mod 3
).
And also read this important note to create optimized code. In most examples here a code is NOT optimized - just to describe a DOM navigation.
Entity card
post
rotating icon (by @dolodobendan)
Entities card (including some special row elements - button, section, divider)
post
font-size for Entities card
post
Entities card with attributes
post
Slider entity inside Entities card
main post
popup baloon issue
hide the popup baloon
"hui-input-number-entity-row"
- entity row for "input_number"
main post
How to make input_number
rows look less different from other entity rows - part 1, part 2
input_select row
main post
How to make input_select
rows look less different from other entity rows - part 1, part 2
How to add secondary_info: last-changed
input-text row
post
How to make input_text
rows look less different from other entity rows - part 1, part 2
input_datetime row
part 1
part 2
How to make input_datetime
rows look less different from other entity rows - part 1, part 2
Conditional row inside Entities card
post
Toggle row inside Entities card
colored checkbox
how to disable a toggle button
how to disable a toggle button - inside auto-entities
moving toggle to the left
Hiding checkboxes inside Entities card
for some entity row
for all entity rows
Animations for Entities card
post
"Chip" buttons
post
card-mod theme for chip buttons in footer
changing styles for a particular button dependently on a state
Cover entity row
main post
disable a cover control conditionally
Light entity row
how to show lights with using only “active” & “inactive” colors
How to manage a row’s height
decrease height
increase height
How to shift rows to the right
post
How to center weblinks & commands
post
“Empty slot” for Entities card
post
Glance card
main post
changing margin
Allocate items in a compact manner
Footer / Header
post
custom:multiple-entity-row
main post
displaying "last-changed"
for items
distribute items evenly
animated icons
custom:fold-entity-row
main post
How to enable / disable a “fold / unfold” control for fold-entity-row
custom:numberbox-card
post
custom:text-divider-row
post
custom:bar-card
animation
2 text lines
displaying an image instead of an icon
centered title
markdown
scrollbar
scrollbar for some text
Picture Glance card
post
changing an icon by card-mod
Sensor card with a graph
post
History-graph card
styling
prevent clipping when using inside stack-in-card
added scrollbar
statistics-graph card
post
grouping / aligning labels
custom:mini-graph-card
main post
animation - blinking name, resized & rotating icon
how to display an additional info on the card
how to display additional text items (prefixes & suffixes)
solid (non-semitransparent) fill
move a graph for the 2nd sensor to the bottom
how to set a color for the last bar
place 2 sensors’ states on the left side
displaying states as a part of the legend
displaying a UoM under the state
displaying a UoM before a state
displaying a state & extrema data on the same line
using card-mod to compare mini-graph-card
& history-graph
non-elegant & unstable way to show labels for X-axis
fixing an issue with a card inside state-switch
imitating statistics card
how to nicely align legend’s elements
compact view when used in horizontal stack or grid
styling Y-axis labels’ background
how to change graph’s color dynamically
Weather Card
post
Styling a card inside ‘custom:config-template-card’
post
Styling a card inside ‘custom:decluttering-card’ + passing a style as a variable
post 1
post 2
custom:template-entity-row
post
Badges
Badges: different styling
Badges: conditional show/hide
Badges: hidden name
Square badges
Dynamic icon
Show either an icon or a value
Manually added UoM
Replacing a state
Replacing a UoM
Gradient colors for a badge dependingly on a value (by @parautenbach)
custom:badge-card
post
Picture Elements card
main post
conditional elements
rotated background image
“selection area”
3 ways to change an element dynamically
Logbook card
main post
styling images by using external js-module
Logbook in a Panel mode
styling a scrollbar (style is unstable)
Media Player card
post
custom:mini-media-player
post
vertical-stack, horizontal-stack
main post
How to fix the “margin-top” problem for a hidden conditional card
Stack inside “hui-element” card
Removing internal borders & margins inside vertical-stack
custom:stack-in-card
main post
example of customizing a width in a horizontal stack
custom:flex-table-card
main post
How to style a header
Map card
styling markers
custom:hui-element
post
custom:restriction-card
post
custom:tabbed-card
post
Sticky cards
post
Additional small title for any card with a title
post
How to scale an iframe content
post
custom:sun-card
post
Other stuff
About these examples
Important notes about navigation
About navigation
About navigation #2
Combining “$:” styles and “not $:” styles
Using variables (especially after 2022.12)
Card for testing colors for binary_sensor
entities (icons, history) (may be useful after 2022.12)
Using "::before"
, "::after"
& "content"
How to change card-mod styles for dark & light modes
How to let HA to choose a default style
How to combine icons
Possible errors when using card-mod
Conditional styles for different clients
Using global macros
Issue with re-defining a variable
Themes
Styling toolbar’s tabs
How to set a fixed width for a right sidebar
Moving a right sidebar to the left
Moving a header to the bottom
Hiding a header
How to change a header’s icon size
Badges in a header
Styling a sidebar
Styling badges
Using classes