Skip to content

fix: Declare the SCSS license headers with line comments - #248

Open
TrevorBurnham wants to merge 1 commit into
cloudscape-design:mainfrom
TrevorBurnham:fix-license-headers-in-scss
Open

fix: Declare the SCSS license headers with line comments#248
TrevorBurnham wants to merge 1 commit into
cloudscape-design:mainfrom
TrevorBurnham:fix-license-headers-in-scss

Conversation

@TrevorBurnham

@TrevorBurnham TrevorBurnham commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Description

Part of cloudscape-design/components#4905.

Sass copies loud comments into the compiled CSS, so a partial's license header is emitted once per stylesheet that @uses it. Both SCSS files in this repo are consumed exactly that way: postbuild copies them into lib, and package.json exports them as the sass/style entry points that @cloudscape-design/components and its siblings @use.

Declaring the header with line comments keeps the notice in the shipped source while keeping it out of consumers' compiled output.

Measured by building cloudscape-design/components against this change: 16.5 KB of duplicated comments removed from its 1770 KB of published CSS, and the median goes from two license blocks per stylesheet down to one. I diffed all 229 compiled stylesheets before and after; the only differences are the removed comments and the generated scoped-name hashes, which embed a content hash and a line number.

Two notes on why this is safe:

  • Neither file is compiled to CSS in this repo. npm run build only copies them.
  • Both are already pure Sass, using @mixin, @use 'sass:map', and // comments throughout their bodies. Nothing can consume them as plain CSS today, so line comments add no new constraint. The block header was the only comment in either file not already using //.

This is independent of the two related PRs and can land in any order:

How has this been tested?

Built cloudscape-design/components against the patched files and compared all 229 compiled stylesheets, as described above.

Sass copies loud comments into the compiled CSS, so the header of a
partial is emitted once per stylesheet that @uses it. Both of these
files are consumed that way: they are copied into lib and exported as
the sass/style entry points for @cloudscape-design/components and its
siblings.

Declaring the header with line comments keeps the notice in the shipped
source while keeping it out of consumers' compiled output. Measured
against cloudscape-design/components, this removes 16.5 KB of duplicated
comments from its 1770 KB of published CSS and takes the median from two
license blocks per stylesheet down to one.

Neither file is compiled to CSS in this repo, and both already use line
comments throughout their bodies.

Refs cloudscape-design/components#4905.
@TrevorBurnham
TrevorBurnham marked this pull request as ready for review August 14, 2026 02:28
@TrevorBurnham
TrevorBurnham requested a review from a team as a code owner August 14, 2026 02:28
@TrevorBurnham
TrevorBurnham requested review from srungta08 and removed request for a team August 14, 2026 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant