Skip to content

Commit 02db8a8

Browse files
fix(styles): resolve Sonar CSS cascade and transition findings
1 parent b705e04 commit 02db8a8

5 files changed

Lines changed: 87 additions & 45 deletions

File tree

‎_sass/styles.scss‎

Lines changed: 66 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ body {
7070

7171
.card-body, .card-custom, .card-footer, .card-img-top, .cr-picker-button, .cr-picker-submenu {
7272
--bs-bg-opacity: 1;
73-
background-color: var(--navbar-col) !important;
73+
background-color: var(--navbar-col);
7474
}
7575

7676
.modal-content {
77-
background-color: var(--footer-col) !important;
77+
background-color: var(--footer-col);
7878
}
7979

8080
/* in line code */
@@ -101,11 +101,11 @@ code {
101101
/* shrink logo when navbar shrinks, instead of hiding it */
102102
.navbar-custom.top-nav-short .avatar-container {
103103
width: 3.125rem;
104-
opacity: 1 !important;
105-
visibility: visible !important;
106-
transition: none !important;
107-
-webkit-transition: none !important;
108-
-moz-transition: none !important;
104+
opacity: 1;
105+
visibility: visible;
106+
transition: none;
107+
-webkit-transition: none;
108+
-moz-transition: none;
109109
}
110110

111111
/* hide search button */
@@ -118,7 +118,7 @@ code {
118118
overflow: hidden;
119119
}
120120
.hover-zoom img {
121-
transition: all 1.5s ease;
121+
transition: transform 1.5s ease;
122122
}
123123
.hover-zoom:hover img {
124124
transform: scale(1.1);
@@ -250,12 +250,35 @@ table tr:nth-child(2n) {
250250
}
251251

252252
/* Gamepad tester */
253+
.gamepad-tester,
254+
.mouse-tester {
255+
padding-bottom: 1.5rem;
256+
padding-top: 1.5rem;
257+
}
258+
259+
@media (min-width: 992px) {
260+
.gamepad-tester,
261+
.mouse-tester {
262+
padding-bottom: 3rem;
263+
padding-top: 3rem;
264+
}
265+
}
266+
253267
.gamepad-tester .container {
254268
max-width: 82rem;
255269
}
256270

257271
.gamepad-tester-header {
258272
max-width: 52rem;
273+
text-align: center;
274+
}
275+
276+
.gamepad-tester-header > h2 {
277+
margin-bottom: 0.5rem;
278+
}
279+
280+
#gamepad-info {
281+
margin-top: 0;
259282
}
260283

261284
.gamepad-kicker,
@@ -282,6 +305,7 @@ table tr:nth-child(2n) {
282305
color: var(--text-col);
283306
display: flex;
284307
gap: 0.75rem;
308+
margin-bottom: 0.5rem;
285309
margin-inline: auto;
286310
max-width: 46rem;
287311
padding: 0.8rem 1rem;
@@ -333,6 +357,10 @@ table tr:nth-child(2n) {
333357
font-size: 0.78rem;
334358
}
335359

360+
.gamepad-selector-panel {
361+
margin-top: 1.5rem;
362+
}
363+
336364
.gamepad-selector-panel,
337365
.gamepad-panel {
338366
background-color: var(--navbar-col);
@@ -725,6 +753,7 @@ table tr:nth-child(2n) {
725753
display: flex;
726754
flex-wrap: wrap;
727755
gap: 0.4rem;
756+
margin-bottom: 1rem;
728757
min-height: 1.5rem;
729758
}
730759

@@ -780,6 +809,7 @@ table tr:nth-child(2n) {
780809

781810
.gamepad-browser-warning {
782811
margin-inline: auto;
812+
margin-top: 1rem;
783813
max-width: 46rem;
784814
}
785815

@@ -870,16 +900,16 @@ table tr:nth-child(2n) {
870900
/* Fit the complete tester workspace into a typical desktop viewport. */
871901
@media (min-width: 1200px) {
872902
.gamepad-tester.has-gamepad {
873-
padding-bottom: 1.25rem !important;
874-
padding-top: 1.25rem !important;
903+
padding-bottom: 1.25rem;
904+
padding-top: 1.25rem;
875905
}
876906

877907
.gamepad-tester.has-gamepad .gamepad-tester-header {
878908
align-items: center;
879909
display: flex;
880910
gap: 1rem;
881911
max-width: none;
882-
text-align: left !important;
912+
text-align: left;
883913
}
884914

885915
.gamepad-tester.has-gamepad .gamepad-kicker,
@@ -891,26 +921,26 @@ table tr:nth-child(2n) {
891921
.gamepad-tester.has-gamepad .gamepad-tester-header > h2 {
892922
flex: 0 0 auto;
893923
font-size: 1.65rem;
894-
margin-bottom: 0 !important;
924+
margin-bottom: 0;
895925
}
896926

897927
.gamepad-tester.has-gamepad .gamepad-status {
898928
flex: 1 1 auto;
899-
margin: 0 !important;
929+
margin: 0;
900930
max-width: none;
901931
padding: 0.65rem 0.85rem;
902932
}
903933

904934
.gamepad-tester.has-gamepad .gamepad-browser-warning {
905-
margin-top: 0.75rem !important;
935+
margin-top: 0.75rem;
906936
max-width: none;
907937
padding: 0.55rem 0.75rem;
908938
}
909939

910940
.gamepad-tester.has-gamepad .gamepad-selector-panel {
911941
display: grid;
912942
grid-template-columns: 13rem minmax(0, 1fr);
913-
margin-top: 0.85rem !important;
943+
margin-top: 0.85rem;
914944
}
915945

916946
.gamepad-tester.has-gamepad .gamepad-selector-heading {
@@ -945,7 +975,7 @@ table tr:nth-child(2n) {
945975
display: grid;
946976
gap: 0.75rem;
947977
grid-template-columns: repeat(12, minmax(0, 1fr));
948-
margin: 0.75rem 0 0 !important;
978+
margin: 0.75rem 0 0;
949979
}
950980

951981
.gamepad-tester.has-gamepad #gamepad-info > [class*="col-"] {
@@ -1079,7 +1109,7 @@ table tr:nth-child(2n) {
10791109
}
10801110

10811111
.gamepad-tester.has-gamepad .gamepad-capability {
1082-
margin-bottom: 0.5rem !important;
1112+
margin-bottom: 0.5rem;
10831113
}
10841114

10851115
.gamepad-tester.has-gamepad .gamepad-range-control {
@@ -1177,6 +1207,11 @@ table tr:nth-child(2n) {
11771207

11781208
.mouse-tester-header {
11791209
max-width: 52rem;
1210+
text-align: center;
1211+
}
1212+
1213+
.mouse-tester-header > h2 {
1214+
margin-bottom: 0.5rem;
11801215
}
11811216

11821217
.mouse-kicker,
@@ -1203,6 +1238,7 @@ table tr:nth-child(2n) {
12031238
color: var(--text-col);
12041239
display: flex;
12051240
gap: 0.75rem;
1241+
margin-bottom: 0.5rem;
12061242
margin-inline: auto;
12071243
max-width: 46rem;
12081244
padding: 0.8rem 1rem;
@@ -1267,6 +1303,7 @@ table tr:nth-child(2n) {
12671303

12681304
.mouse-browser-warning {
12691305
margin-inline: auto;
1306+
margin-top: 1rem;
12701307
max-width: 46rem;
12711308
}
12721309

@@ -1281,7 +1318,7 @@ table tr:nth-child(2n) {
12811318
}
12821319

12831320
.mouse-workspace {
1284-
margin-top: 1.5rem !important;
1321+
margin-top: 1.5rem;
12851322
}
12861323

12871324
.mouse-panel {
@@ -1648,16 +1685,16 @@ table tr:nth-child(2n) {
16481685

16491686
@media (min-width: 1200px) {
16501687
.mouse-tester {
1651-
padding-bottom: 1.25rem !important;
1652-
padding-top: 1.25rem !important;
1688+
padding-bottom: 1.25rem;
1689+
padding-top: 1.25rem;
16531690
}
16541691

16551692
.mouse-tester-header {
16561693
align-items: center;
16571694
display: flex;
16581695
gap: 1rem;
16591696
max-width: none;
1660-
text-align: left !important;
1697+
text-align: left;
16611698
}
16621699

16631700
.mouse-tester-header .mouse-kicker,
@@ -1669,22 +1706,22 @@ table tr:nth-child(2n) {
16691706
.mouse-tester-header > h2 {
16701707
flex: 0 0 auto;
16711708
font-size: 1.65rem;
1672-
margin-bottom: 0 !important;
1709+
margin-bottom: 0;
16731710
}
16741711

16751712
.mouse-status {
16761713
flex: 1 1 auto;
1677-
margin: 0 !important;
1714+
margin: 0;
16781715
max-width: none;
16791716
padding: 0.65rem 0.85rem;
16801717
}
16811718

16821719
.mouse-workspace {
1683-
margin-top: 0.75rem !important;
1720+
margin-top: 0.75rem;
16841721
}
16851722

16861723
.mouse-browser-warning {
1687-
margin-top: 0.75rem !important;
1724+
margin-top: 0.75rem;
16881725
max-width: none;
16891726
padding: 0.55rem 0.75rem;
16901727
}
@@ -1825,15 +1862,16 @@ table tr:nth-child(2n) {
18251862

18261863
.commit-bar-active {
18271864
background-color: rgb(64, 196, 99);
1865+
opacity: var(--commit-bar-opacity, 1);
18281866
}
18291867

18301868
.commit-bar-active:hover {
1831-
opacity: 1 !important;
1869+
opacity: 1;
18321870
}
18331871

1834-
/* Override Bootstrap's text-muted to use theme colors */
1872+
/* Supply Bootstrap's text-muted utility with the theme color. */
18351873
.text-muted {
1836-
color: var(--footer-text-col) !important;
1874+
--bs-secondary-color: var(--footer-text-col);
18371875
}
18381876

18391877
/* Theme-aware outline button: dark border/text in light mode, light in dark mode */

‎assets/js/projects.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ function loadCommitActivity(repo, card_footer) {
112112
height: ${Math.max(height, 10)}%;
113113
border-radius: 1px;
114114
transition: all 0.2s ease;
115-
opacity: ${week.total === 0 ? 1 : intensity};
115+
--commit-bar-opacity: ${intensity};
116116
`
117117
bar.title = `${week.total} commits this week`
118118
activity_container.appendChild(bar)

‎gamepad-tester.html‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@
1717
</script>
1818

1919
<!-- Gamepad Tester section -->
20-
<section class="gamepad-tester py-4 py-lg-5" id="GamepadTester">
20+
<section class="gamepad-tester" id="GamepadTester">
2121
<div class="container">
22-
<header class="gamepad-tester-header mx-auto text-center">
22+
<header class="gamepad-tester-header mx-auto">
2323
<div class="gamepad-kicker mb-2">
2424
<i class="fas fa-gamepad" aria-hidden="true"></i>
2525
Browser controller diagnostics
2626
</div>
27-
<h2 class="display-6 fw-bolder mb-2">Gamepad Tester</h2>
27+
<h2 class="display-6 fw-bolder">Gamepad Tester</h2>
2828
<p class="lead text-muted mb-4">Check buttons, sticks, triggers, axes, and vibration in real time.</p>
29-
<div id="gamepad-status" class="alert alert-warning gamepad-status mb-2">
29+
<div id="gamepad-status" class="alert alert-warning gamepad-status">
3030
<span class="gamepad-status-indicator" aria-hidden="true"></span>
3131
<output id="gamepad-status-message" aria-live="polite">No gamepad detected. Connect a gamepad and press any button.</output>
3232
</div>
@@ -36,7 +36,7 @@ <h2 class="display-6 fw-bolder mb-2">Gamepad Tester</h2>
3636
</p>
3737
</header>
3838

39-
<div id="firefox-switch-warning" class="gamepad-browser-warning gamepad-inline-notice mt-3" aria-live="polite" hidden>
39+
<div id="firefox-switch-warning" class="gamepad-browser-warning gamepad-inline-notice" aria-live="polite" hidden>
4040
<i class="fas fa-triangle-exclamation mt-1" aria-hidden="true"></i>
4141
<span>
4242
Firefox versions before 155 can report incorrect buttons and axes for Nintendo Switch controllers.
@@ -45,7 +45,7 @@ <h2 class="display-6 fw-bolder mb-2">Gamepad Tester</h2>
4545
</span>
4646
</div>
4747

48-
<section class="gamepad-selector-panel mt-4" id="gamepad-selector-container" style="display: none;" aria-labelledby="gamepad-selector-heading">
48+
<section class="gamepad-selector-panel" id="gamepad-selector-container" style="display: none;" aria-labelledby="gamepad-selector-heading">
4949
<div class="gamepad-selector-heading">
5050
<div>
5151
<span class="gamepad-panel-eyebrow">Devices</span>
@@ -56,7 +56,7 @@ <h3 class="h5 mb-0" id="gamepad-selector-heading">Connected controllers</h3>
5656
<div class="gamepad-selector-grid" id="gamepad-selector"></div>
5757
</section>
5858

59-
<div class="row g-4 mt-0" id="gamepad-info" style="display: none;">
59+
<div class="row g-4" id="gamepad-info" style="display: none;">
6060
<div class="col-12">
6161
<section class="gamepad-panel gamepad-visual-panel" aria-labelledby="controller-visual-heading">
6262
<div class="gamepad-panel-header">
@@ -148,7 +148,7 @@ <h3 class="h5 mb-0" id="vibration-heading">Vibration</h3>
148148
</div>
149149
</div>
150150
<div class="gamepad-panel-body">
151-
<div id="vibration-status" class="gamepad-capability mb-3"></div>
151+
<div id="vibration-status" class="gamepad-capability"></div>
152152

153153
<div id="dual-rumble-controls" class="d-none">
154154
<div class="gamepad-range-control">

‎mouse-tester.html‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@
1010
---
1111

1212
<!-- Mouse Tester section -->
13-
<section class="mouse-tester py-4 py-lg-5" id="MouseTester">
13+
<section class="mouse-tester" id="MouseTester">
1414
<div class="container">
15-
<header class="mouse-tester-header mx-auto text-center">
15+
<header class="mouse-tester-header mx-auto">
1616
<div class="mouse-kicker mb-2">
1717
<i class="fas fa-computer-mouse" aria-hidden="true"></i>
1818
Browser mouse diagnostics
1919
</div>
20-
<h2 class="display-6 fw-bolder mb-2">Mouse Tester</h2>
20+
<h2 class="display-6 fw-bolder">Mouse Tester</h2>
2121
<p class="lead text-muted mb-4">Check buttons, movement, and scrolling in real time.</p>
22-
<div id="mouse-status" class="alert alert-warning mouse-status mb-2">
22+
<div id="mouse-status" class="alert alert-warning mouse-status">
2323
<span class="mouse-status-indicator" aria-hidden="true"></span>
2424
<output id="mouse-status-message" aria-live="polite">Move, click, or scroll inside the test area to begin.</output>
2525
</div>
@@ -29,7 +29,7 @@ <h2 class="display-6 fw-bolder mb-2">Mouse Tester</h2>
2929
</p>
3030
</header>
3131

32-
<div id="firefox-mouse-buttons-warning" class="mouse-browser-warning mouse-inline-notice mt-3" aria-live="polite" hidden>
32+
<div id="firefox-mouse-buttons-warning" class="mouse-browser-warning mouse-inline-notice" aria-live="polite" hidden>
3333
<i class="fas fa-triangle-exclamation mt-1" aria-hidden="true"></i>
3434
<span>
3535
Firefox may use Back and Forward mouse buttons for browser navigation even when this tester detects the button press.
@@ -38,7 +38,7 @@ <h2 class="display-6 fw-bolder mb-2">Mouse Tester</h2>
3838
</span>
3939
</div>
4040

41-
<div class="row g-4 mt-0 mouse-workspace">
41+
<div class="row g-4 mouse-workspace">
4242
<div class="col-xl-7">
4343
<section class="mouse-panel mouse-visual-panel h-100" aria-labelledby="mouse-visual-heading">
4444
<div class="mouse-panel-header">

0 commit comments

Comments
 (0)