Skip to content

Commit 7a052fd

Browse files
authored
Merge pull request #3241 from codecrafters-io/fix-dark-mode-flicker
Fix Dark Mode flickering when switching between dark-mode-enabled routes
2 parents 24d9efa + 58cfe51 commit 7a052fd

File tree

8 files changed

+43
-7
lines changed

8 files changed

+43
-7
lines changed

app/components/concepts-page/concept-card.hbs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@
6464
{{/if}}
6565
</span>
6666

67-
{{svg-jar "arrow-right" class="w-4 fill-current text-gray-300 dark:text-gray-700 group-hover:text-teal-500 transition-colors"}}
67+
{{svg-jar
68+
"arrow-right"
69+
class="w-4 fill-current text-gray-300 dark:text-gray-700 group-hover:text-teal-500 dark:group-hover:text-teal-500 transition-colors"
70+
}}
6871
</div>
6972
</div>
7073
</LinkTo>

app/components/course-card/index.hbs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<div class="flex items-center mb-3 flex-wrap gap-y-2 pr-10">
2121
<div class="text-lg font-semibold text-gray-800 dark:text-gray-200 mr-2" data-test-course-name>
2222
{{#if this.isSkeleton}}
23-
<span class="inline-block bg-gray-100 rounded-sm">{{#each (repeat 30)}}&nbsp;{{/each}}</span>
23+
<span class="inline-block bg-gray-100 dark:bg-gray-800 rounded-sm">{{#each (repeat 30)}}&nbsp;{{/each}}</span>
2424
{{else}}
2525
<span>{{this.course.name}}</span>
2626
{{/if}}
@@ -89,7 +89,10 @@
8989
{{/if}}
9090
</span>
9191

92-
{{svg-jar "arrow-right" class="w-4 fill-current text-gray-300 group-hover:text-teal-500 transition-colors"}}
92+
{{svg-jar
93+
"arrow-right"
94+
class="w-4 fill-current text-gray-300 dark:text-gray-700 group-hover:text-teal-500 dark:group-hover:text-teal-500 transition-colors"
95+
}}
9396
{{/if}}
9497
</div>
9598
</div>

app/components/course-stage-screencast-preview.hbs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@
3434
View
3535
</span>
3636

37-
{{svg-jar "arrow-right" class="w-4 fill-current text-gray-300 group-hover:text-teal-500 transition-colors"}}
37+
{{svg-jar
38+
"arrow-right"
39+
class="w-4 fill-current text-gray-300 dark:text-gray-700 group-hover:text-teal-500 dark:group-hover:text-teal-500 transition-colors"
40+
}}
3841
</div>
3942
</div>
4043
</div>

app/components/tracks-page/track-card/index.hbs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@
4545
{{/if}}
4646
</span>
4747

48-
{{svg-jar "arrow-right" class="w-4 fill-current text-gray-300 dark:text-gray-700 group-hover:text-teal-500 transition-colors"}}
48+
{{svg-jar
49+
"arrow-right"
50+
class="w-4 fill-current text-gray-300 dark:text-gray-700 group-hover:text-teal-500 dark:group-hover:text-teal-500 transition-colors"
51+
}}
4952
</div>
5053
</div>
5154
</div>

app/routes/catalog-loading.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import Route from '@ember/routing/route';
2+
import RouteInfoMetadata, { RouteColorScheme } from 'codecrafters-frontend/utils/route-info-metadata';
3+
4+
export default class CatalogLoadingRoute extends Route {
5+
buildRouteInfoMetadata() {
6+
return new RouteInfoMetadata({ allowsAnonymousAccess: true, colorScheme: RouteColorScheme.Both });
7+
}
8+
}

app/routes/loading.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import Route from '@ember/routing/route';
2+
import RouteInfoMetadata, { RouteColorScheme } from 'codecrafters-frontend/utils/route-info-metadata';
3+
4+
export default class LoadingRoute extends Route {
5+
buildRouteInfoMetadata() {
6+
return new RouteInfoMetadata({ allowsAnonymousAccess: true, colorScheme: RouteColorScheme.Both });
7+
}
8+
}

app/routes/roadmap-loading.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import Route from '@ember/routing/route';
2+
import RouteInfoMetadata, { RouteColorScheme } from 'codecrafters-frontend/utils/route-info-metadata';
3+
4+
export default class RoadmapLoadingRoute extends Route {
5+
buildRouteInfoMetadata() {
6+
return new RouteInfoMetadata({ allowsAnonymousAccess: true, colorScheme: RouteColorScheme.Both });
7+
}
8+
}

app/templates/catalog-loading.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{{page-title "Catalog"}}
22

33
<div class="container mx-auto lg:max-w-(--breakpoint-lg) pt-6 md:pt-10 pb-10 md:pb-48 px-3 md:px-6" data-test-loading>
4-
<div class="border-b border-gray-200 pb-2 mb-6">
4+
<div class="border-b border-gray-200 dark:border-white/5 pb-2 mb-6">
55
<h1 class="text-3xl text-gray-700 font-bold tracking-tighter">Challenges</h1>
66
</div>
77

@@ -11,7 +11,7 @@
1111
{{/each}}
1212
</div>
1313

14-
<div class="border-b border-gray-200 pb-2 mb-6">
14+
<div class="border-b border-gray-200 dark:border-white/5 pb-2 mb-6">
1515
<h1 class="text-3xl text-gray-700 font-bold tracking-tighter">Language Tracks</h1>
1616
</div>
1717

0 commit comments

Comments
 (0)