refactor: echo-433: scss feature rewrites ls label studioweb#9531
Merged
robot-ci-heartex merged 8 commits intodevelopfrom Mar 10, 2026
Merged
Conversation
✅ Deploy Preview for heartex-docs canceled.
|
✅ Deploy Preview for label-studio-docs-new-theme canceled.
|
✅ Deploy Preview for label-studio-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for label-studio-playground ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
c27776c to
18b0639
Compare
Made-with: Cursor
Promotes multi-use SCSS variables that were inlined as literals back to named constants using CSS custom properties: - $gap: 30px → --grid-gap (Grid.module.scss, 2 uses) - $size: 20px → --badge-size (SimpleBadge.module.scss, 4 uses) - $scroll-width: 5px → --scroll-width (Config.scss, 2 uses) Custom properties are defined on the container elements that parent both the grid and the navigation buttons, ensuring correct CSS inheritance for all consumers. Single-use variables ($border-thin, $check-icon, $handle-radius, $hitbox-width) are left as inline literals since named constants add no value for one-off values. Made-with: Cursor
Extract identical custom-scrollbar CSS blocks from upload_page > main and upload_page__code-wrapper > div into a single shared selector, reducing code duplication from the previous mixin inlining. Made-with: Cursor
Annotate raw pixel breakpoints with descriptive comments (phone, tablet+, desktop, compact desktop, wide desktop) so the intent is preserved now that SCSS variable aliases have been removed. Made-with: Cursor
18b0639 to
0da398a
Compare
Replace the SCSS %settings-title placeholder with a combined CSS selector at the top of the file, grouping the 3 consumers into a single rule block. Each individual selector keeps only its unique overrides. Produces nearly identical compiled CSS to @extend. Made-with: Cursor
… Choice.scss Replace the SCSS-specific @at-root and selector-append() usage with explicit flat CSS selectors. The selectors are moved outside the nesting block and written out directly, producing the same compiled result. Made-with: Cursor
Convert all single-line SCSS comments (//) to standard CSS block comments (/* */) across 42 files. This removes the last SCSS-specific syntax that would prevent CSS parsers from processing these files. Made-with: Cursor
0da398a to
8675516
Compare
nass600
approved these changes
Mar 10, 2026
yyassi-heartex
approved these changes
Mar 10, 2026
bmartel
approved these changes
Mar 10, 2026
Contributor
Author
|
/git merge
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Eliminates all SCSS-specific syntax from both LS and LSE web codebases —
@mixin/@include,#{interpolation},@if/@else,@extend,@at-root/selector-append,$variables,//comments, and SCSS partial@imports — preparing all.scssfiles for the final loader swap fromsass-loadertopostcss-loader.What changed
Commit 1 — Zero-diff SCSS feature rewrites
LS (label-studio/web) — 17 files, 4 deleted:
_functions.scssget-color()was unused_variables.scssget-color()_mixins.scssrespond()andwaiting()inlined at all call siteswaiting.scss(datamanager)Label.scssglobal.scss@importof deleted partials; added@keyframes waitingdirectlyApp.scss,Grid.module.scss,Panel.module.scss,Controls.module.scss@include respond("phone"/"tablet")as@media (width <= 760px/1200px)Label.scsswaiting()mixin body +@keyframes waitingGridView.scss@for $i from 1 to 15into 14 static rulesSimpleBadge.module.scss$size: 20px(and$size / 2computed to10px)Paragraphs.module.scss$border-thincheckbox.module.scss$check-icondata URIRichText.scss$handle-radius,$hitbox-width+ arithmeticConfig.scss$scroll-widthImport.scss@mixin custom-scrollbar, inlined at 2 call sitesLSE (label-studio-enterprise/web) — 6 files, 1 deleted:
Import.scss@mixin custom-scrollbar, inlined body at 2 call sitesConfig.scss@mixin toggle-items-tab-styles, inlined body at 2 call sitesMembers.scss@import skeleton-loaderwith@keyframes shimmer, inlined mixinProjectCard.scss@import skeleton-loaderwith@keyframes shimmer, inlined mixin at 2 sitesChat.scssinset-shadow,role-styling,role-selected-styling), expanded 17@includecalls with resolved parameters — eliminates all#{$role}interpolation and@if/@elseskeleton-loader.scssCommit 2 — Promote inlined variables to CSS custom properties (LS)
Multi-use SCSS variables that were inlined as literal values in commit 1 are promoted back to named constants using CSS custom properties:
Grid.module.scss$gap: 30px--grid-gap(on.container, .containerVirtualized)SimpleBadge.module.scss$size: 20px--badge-sizeConfig.scss$scroll-width: 5px--scroll-widthCommit 3 — Consolidate duplicate CSS blocks using shared selectors
LS:
Import.scss— 2 identical custom-scrollbar blocks → shared selectorLSE:
Chat.scss(3 inset-shadow blocks),Import.scss(2 scrollbar blocks),Config.scss(2 toggle-items blocks),ProjectCard.scss(2 skeleton-loader blocks) — all consolidatedCommit 4 — Add breakpoint alias comments to media queries
Annotates raw pixel breakpoints with descriptive inline comments (
/* phone */,/* desktop */, etc.) to preserve semantic intent after SCSS variable aliases were removed. 16 files across both repos.Commit 5 — Replace
@extend %settings-titlewith shared selector (LS)Replaces the SCSS
%settings-titleplaceholder with a combined CSS selector at the top of the file, grouping the 3 consumers (.settings__title,.settings_newUI .settings__label__title,.settings-modal :global(.ant-tabs-tab .ant-tabs-tab-btn)) into a single shared rule block. Each individual selector keeps only its unique overrides. Produces nearly identical compiled CSS to the original@extend.Commit 6 — Replace
@at-root/selector-appendwith flat CSS selectors (LS)Replaces SCSS-specific
@at-root #{selector-append(&,_leaf,&,_hidden)}inChoice.scsswith the explicit flat CSS selectors it compiled to. The selectors are moved outside the nesting block and written out directly.Commit 7 — Convert remaining SCSS
$variablesto CSS custom properties (LSE)Config.scss$scroll-width: 5pxProjectCard.scss$transition(21 uses)--transitionCSS custom propertyProjectDashboard.scss$stripesgradientDrawer.scss$header-height: 40px--header-heightCSS custom propertyDrawer.scss$header-background,$icon-colorDrawer.scss$grape-500Commit 8 — Convert SCSS
//comments to CSS/* */commentsConverts all single-line SCSS comments (
//) to standard CSS block comments (/* */) across 42 LS files and 28 LSE files. This removes the last SCSS-specific syntax that would prevent CSS parsers from processing these files.SCSS features eliminated (complete list)
@mixin/@include— all definitions and call sites removed#{interpolation}— all occurrences removed@if/@else— all occurrences removed@extend/%placeholder— inlined at all usage sites@at-root/selector-append— replaced with flat CSS selectors@importof SCSS partials — removed (theme@importchain stays until loader swap)@forloop — expanded to static rulescalc()with CSS custom properties$variables— converted to CSS custom properties or inlined//single-line comments — converted to/* */What remains before renaming
.scss→.csssass-loaderforpostcss-loader— webpack config change +postcss-nestingplugin@importstatements — adjust topostcss-importcompatible format (~18 files).scss→.cssand update all import pathsValidation
Commits 1-4 validated via
validate-scss-transform.js, production builds, and sorted CSS diffs.Commits 5-8 intentionally change compiled CSS structure (inlined properties replace grouped selectors, literal values become
var()references,//comments become/* */). Visual output is identical; builds succeed in both repos.Test plan
validate-scss-transform.jssnapshot/validate passes (commit 1)view_all/grid.cy.tsandview_all/readonly.cy.tspass locally