Skip to content

Commit fe3f04f

Browse files
committed
static: convert the login page to plain CSS
Since 2023 CSS Nesting is baseline supported. [1] Initially it required one to write `.foo { & .bar { } }` but that restriction has been lifted for class / id selectors since 2025. To keep maximum compatibility with older browsers use the & everywhere. Note that for type and pseudo class selectors an & is always required otherwise it would result into `.parent-rule *:hover` instead of `.parent-rule:hover`. [2] The main motivation to move the login page to plain CSS is an idea to let Anaconda bring their own login.css and not requiring a SASS compilation step makes that much easier. Secondly for theming it is easier to reason with a plain CSS file. [1] https://caniuse.com/css-nesting [2] https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Selectors/Nesting_selector
1 parent 2b3f0f4 commit fe3f04f

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -455,32 +455,32 @@ label.checkbox {
455455
background-color: var(--color-background);
456456
border-radius: var(--pf-t--global--border--radius--medium);
457457

458-
.pf-v6-c-alert__icon {
458+
& .pf-v6-c-alert__icon {
459459
grid-column: icon;
460460
}
461461

462-
.pf-v6-c-alert__title,
463-
.pf-v6-c-alert__description {
462+
& .pf-v6-c-alert__title,
463+
& .pf-v6-c-alert__description {
464464
grid-column: content;
465465
}
466466

467-
.pf-v6-c-alert__icon {
467+
& .pf-v6-c-alert__icon {
468468
/* vertically align the icon's top edge with the text; https://blog.kizu.dev/cap-height-align/ */
469469
margin-block-start: calc((1cap - 1ex) / 2);
470470

471-
svg {
471+
& svg {
472472
display: block;
473473
block-size: var(--pf-t--global--icon--size--lg);
474474
inline-size: var(--pf-t--global--icon--size--lg);
475475
color: var(--alert-border-color);
476476
}
477477
}
478478

479-
.pf-v6-c-alert__title {
479+
& .pf-v6-c-alert__title {
480480
font-weight: 500;
481481
}
482482

483-
p {
483+
& p {
484484
margin: 0;
485485
}
486486

@@ -534,11 +534,11 @@ html body.login-pf {
534534
inline-size: 100%;
535535
border-radius: var(--pf-t--global--border--radius--large) var(--pf-t--global--border--radius--large);
536536

537-
.container-body {
537+
& .container-body {
538538
padding: var(--pf-t--global--spacer--2xl);
539539
}
540540

541-
.container-footer {
541+
& .container-footer {
542542
padding-block: var(--pf-t--global--spacer--xl);
543543
padding-inline: var(--pf-t--global--spacer--2xl);
544544
}
@@ -670,7 +670,7 @@ html:not(.pf-v6-theme-dark) #login-wait-validating .spinner {
670670
transform: rotate(90deg);
671671
}
672672

673-
path {
673+
& path {
674674
fill: var(--color-text);
675675
}
676676
}
@@ -859,19 +859,19 @@ details > summary:hover {
859859
}
860860

861861
.unsupported-browser {
862-
#brand {
862+
& #brand {
863863
display: none;
864864
}
865865

866-
ul {
866+
& ul {
867867
display: inline-block;
868868
text-align: start;
869869
color: var(--color-text-lighter);
870870
margin-block: 0 1rem;
871871
margin-inline: 0;
872872
}
873873

874-
a {
874+
& a {
875875
font-weight: 700;
876876
}
877877
}
@@ -954,15 +954,15 @@ body.login-pf {
954954
grid-template-columns: 1fr var(--content-width) auto 1fr;
955955
column-gap: var(--gap);
956956

957-
#brand img {
957+
& #brand img {
958958
margin: 0;
959959
text-align: start;
960960
}
961961
}
962962

963963
/* Mobile-specific */
964964
@media (width < 900px) {
965-
#badge {
965+
& #badge {
966966
background-position: center;
967967
margin: 2rem;
968968
}

pkg/static/login.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: LGPL-2.1-or-later
2-
import "./login.scss";
2+
import "./login.css";
33

44
function debug(...args) {
55
if (window.debugging === 'all' || window.debugging?.includes('login'))

0 commit comments

Comments
 (0)