File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1071,6 +1071,11 @@ describe('Chat', () => {
10711071 const styles = document . createElement ( 'style' ) ;
10721072 styles . setAttribute ( 'id' , 'adopt-styles-test' ) ;
10731073 styles . innerHTML = `
1074+ .custom-background {
1075+ background-color: rgb(255, 255, 0);
1076+ }
1077+
1078+ /* override */
10741079 .custom-background {
10751080 background-color: rgb(255, 0, 0);
10761081 }
Original file line number Diff line number Diff line change @@ -172,7 +172,8 @@ class AdoptedStylesController implements ReactiveController {
172172 }
173173
174174 try {
175- constructed . insertRule ( rule . cssText ) ;
175+ // insert last to keep rules/override order:
176+ constructed . insertRule ( rule . cssText , constructed . cssRules . length ) ;
176177 hasRules = true ;
177178 } catch {
178179 // Skip rules that cannot be cloned (e.g., invalid syntax)
You can’t perform that action at this time.
0 commit comments