File tree Expand file tree Collapse file tree 3 files changed +48
-0
lines changed Expand file tree Collapse file tree 3 files changed +48
-0
lines changed Original file line number Diff line number Diff line change 167
167
</p >
168
168
169
169
<% - example (` <button[[ class="focused"]]>I am focused</button>` ) %>
170
+
171
+ <p >
172
+ Images and elements with <code >[role=img]</code > inside the button will get disabled state when the button is disabled.
173
+ </p >
174
+
175
+ <% - example (`
176
+ <button style="height: auto; padding: 16px;">
177
+ <img style="width: 32px;height: 32px;" src="mail-icon.png" alt="icon"/>
178
+ </button>
179
+ <button style="height: auto; padding: 16px;" disabled>
180
+ <img style="width: 32px;height: 32px;" src="mail-icon.png" alt="icon"/>
181
+ </button>
182
+ ` ) %>
170
183
</div >
171
184
</section >
172
185
987
1000
subscribing to more fun things on <a href =" https://twitter.com/jdan" >my twitter</a >. 👋
988
1001
</p >
989
1002
</main >
1003
+
1004
+ <svg id =" filters-98css" >
1005
+ <defs >
1006
+ <filter id =" disabled-filter-98css" >
1007
+ <feColorMatrix
1008
+ type =" matrix"
1009
+ values =" 1 0 0 0 0
1010
+ 0 1 0 0 0
1011
+ 0 0 1 0 0
1012
+ -21.25 -71.54 -7.21 40 0"
1013
+ result =" color-matrix"
1014
+ ></feColorMatrix >
1015
+ <feFlood flood-color =" grey" result =" color" ></feFlood >
1016
+ <feComposite in =" color" in2 =" color-matrix" operator =" in" ></feComposite >
1017
+ <feDropShadow
1018
+ dx =" 1"
1019
+ dy =" 1"
1020
+ stdDeviation =" 0"
1021
+ flood-color =" white"
1022
+ ></feDropShadow >
1023
+ </filter >
1024
+ </defs >
1025
+ </svg >
990
1026
</body >
991
1027
</html >
Original file line number Diff line number Diff line change @@ -200,6 +200,11 @@ input[type="reset"]:disabled,
200
200
text-shadow : 1px 1px 0 var (--button-highlight );
201
201
}
202
202
203
+ button : disabled img ,
204
+ button : disabled [role = "img" ] {
205
+ filter : url ("#disabled-filter-98css" );
206
+ }
207
+
203
208
.window {
204
209
box-shadow : var (--border-window-outer ), var (--border-window-inner );
205
210
background : var (--surface );
@@ -885,3 +890,10 @@ table > tbody > tr > * {
885
890
padding : 0 var (--grouped-element-spacing );
886
891
height : 14px ;
887
892
}
893
+
894
+ # filters-98css {
895
+ position : absolute;
896
+ pointer-events : none;
897
+ top : 0 ;
898
+ left : 0 ;
899
+ }
You can’t perform that action at this time.
0 commit comments