Skip to content

feat: standalone visual context CSS generation#180

Draft
amanabiy wants to merge 5 commits into
mainfrom
dev-v3-amanabiy
Draft

feat: standalone visual context CSS generation#180
amanabiy wants to merge 5 commits into
mainfrom
dev-v3-amanabiy

Conversation

@amanabiy

@amanabiy amanabiy commented May 28, 2026

Copy link
Copy Markdown
Member

Issue #, if available:

This change allows new visual contexts to be compiled to separate CSS files that are only included in the bundle when the component is imported, making context addition scalable without growing the base bundle.

Description of changes:

Adds a destination field to the Context interface. When set, the context is excluded from the base styles and compiled to its own CSS file at the specified path. The component that uses the context imports this file directly.

// In the context definition:
{
  id: 'navigation-bar',
  selector: '.awsui-context-navigation-bar',
  destination: 'visual-contexts/navigation-bar.scoped.css',
  defaultMode: 'dark',
  tokens: { ... }
}

// In the component:
import '../visual-contexts/navigation-bar.scoped.css';

Tested with

  • components PR #4477 (last commit) consuming directly from this branch
  • Generated file verified: correct token overrides, :not(#\9) specificity, excluded from base styles, existing contexts unchanged

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@amanabiy
amanabiy requested a review from pan-kot May 28, 2026 12:27
@amanabiy
amanabiy force-pushed the dev-v3-amanabiy branch 3 times, most recently from b4562d5 to 5c4b285 Compare May 28, 2026 15:29
@codecov

codecov Bot commented May 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.56604% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.74%. Comparing base (533392f) to head (3f05583).

Files with missing lines Patch % Lines
src/build/tasks/standalone-contexts.ts 50.00% 4 Missing ⚠️
src/shared/declaration/index.ts 97.05% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #180      +/-   ##
==========================================
- Coverage   96.92%   96.74%   -0.18%     
==========================================
  Files          54       55       +1     
  Lines        1365     1413      +48     
  Branches      246      250       +4     
==========================================
+ Hits         1323     1367      +44     
- Misses         36       40       +4     
  Partials        6        6              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@amanabiy
amanabiy marked this pull request as ready for review May 28, 2026 15:38
@amanabiy
amanabiy requested a review from a team as a code owner May 28, 2026 15:38
@amanabiy
amanabiy removed the request for review from a team May 28, 2026 15:40
@pan-kot
pan-kot marked this pull request as draft June 11, 2026 08:00
amanabiy and others added 5 commits July 20, 2026 17:27
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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.

2 participants