-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbutton_mini.yaml
76 lines (70 loc) · 1.78 KB
/
button_mini.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
button_mini:
template:
- style_helper
- state_helper
- actions
- show_only_icon
- resizable
- interactive
variables:
height: 40px
symbol:
symbol_width: 50%
symbol_font_size: 10pt
symbol_color: var( --ha-card-background, var(--card-background-color, white) )
size: 30px
custom_fields:
symbol: >
[[[
if (!variables.symbol) return ''
let sym = String(variables.symbol)
if (sym.search('mdi:') !== -1) {
return `<ha-icon icon="${sym}" class="cbc-symbol" />`
}
sym = sym.substring(0,1)
return `<span class="cbc-symbol">${sym}</span>`
]]]
styles:
card:
- min-width: 30px
custom_fields:
symbol:
- width: "[[[ return variables.symbol_width ]]]"
- position: absolute
- justify-self: center
- margin-top: "-25%"
- color: "[[[ return variables.symbol_color ]]]"
- font-size: "[[[ return variables.symbol_font_size ]]]"
- font-weight: bold
############| Button Mini - Embeded |###########################>
button_mini_embed:
variables:
width: 30px
template:
- button_mini
- transparent
styles:
card:
- min-width: 10px
############| Button Mini + State |###########################>
button_mini_state:
template:
- button_mini
layout: icon_state
entity: input_boolean.air_circulation
show_state: true
# color_type: card
size: 25px
styles:
card:
- height: 40px
- width: 70px
state:
- justify-self: center
- text-align: left
# - margin-left: '-5px'
- font-size: 11pt
icon:
- justify-self: end
- margin-left: 5px
#########################################################################/