File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 11document . addEventListener ( 'DOMContentLoaded' , function ( ) {
22 const body = document . querySelector ( 'body' ) ;
3- const artDirectionEls = document . querySelectorAll ( 'rht-art-direction ' ) ;
3+ const pictureEls = document . querySelectorAll ( 'rht-picture ' ) ;
44
55 var observer = new MutationObserver ( function ( mutations ) {
66 mutations . forEach ( function ( mutation ) {
77 if ( mutation . type === "attributes" ) {
88 let styleAttr = mutation . target . getAttribute ( 'style' ) ;
99
1010 if ( styleAttr . includes ( 'color-scheme: dark' ) ) {
11- artDirectionEls . forEach ( ( art ) => {
11+ pictureEls . forEach ( ( art ) => {
1212 art . classList . add ( 'dark' ) ;
1313 } ) ;
1414 } else {
15- artDirectionEls . forEach ( ( art ) => {
15+ pictureEls . forEach ( ( art ) => {
1616 art . classList . remove ( 'dark' ) ;
1717 } ) ;
1818 }
Original file line number Diff line number Diff line change 230230
231231 [slot = "header" ],
232232 [slot = "image" ] {
233- rht-art-direction {
233+ rht-picture {
234234 display : grid;
235235 grid-template-columns : 1fr ;
236236 align-content : center;
319319}
320320
321321@layer pseudo-components {
322- rht-art-direction {
322+ rht-picture {
323323 .img-on-dark {
324324 display : none;
325325 }
Original file line number Diff line number Diff line change @@ -26,10 +26,10 @@ <h2 id="h-featured" class="visually-hidden">Featured projects</h2>
2626 {% for feature in featured %}
2727 < rh-card >
2828 < a href ="{{ feature.github }} " slot ="header ">
29- < rht-art-direction >
29+ < rht-picture >
3030 < img class ="img-{{ feature.logo }} img-on-light " src ="img/new-logo-{{ feature.logo }}.png " alt ="{{ feature.name }} ">
3131 < img class ="img-{{ feature.logo }} img-on-dark " src ="img/new-logo-{{ feature.logo }}-on-dark.png " alt ="{{ feature.name }} ">
32- </ rht-art-direction >
32+ </ rht-picture >
3333 </ a >
3434
3535 < p > {{feature.description}}</ p >
@@ -117,7 +117,7 @@ <h3 class="header">{{ elem.heading }}</h3>
117117{% include "partials/_footer.html" %}
118118
119119< script src ="/js/table-search.js "> </ script >
120- < script src ="/js/art-direction .js "> </ script >
120+ < script src ="/js/rht-picture .js "> </ script >
121121
122122</ body >
123123</ html >
You can’t perform that action at this time.
0 commit comments