The theme currently compiles source files through gulp-dart-sass before PostCSS runs. The only SCSS features in use are variables (10 breakpoints), nesting, mixins, and @import — all of which have native CSS equivalents. This issue tracks replacing the SCSS build step with a plain CSS source pipeline.

Changes:

Remove gulp-dart-sass; add gulp-rename to handle the component source path mapping
Replace sass/global/_variables.scss with src/base/breakpoints.css — a new file that sets 10 breakpoint custom properties on html using @media, making them queryable anywhere via @container style(--var: large)
Delete sass/global/_mixins.scss; inline mixin content at each call site
Rename sass/ → src/ and convert all .scss files to .css
Convert @media ($variable) SCSS syntax to @container style(--variable: large) throughout
Lift &--modifier BEM concatenation (invalid in native CSS nesting) to explicit sibling selectors in the four component files that used it
Move components/*/component.scss into components/*/src/component.css; update the Gulpfile to strip the /src/ path segment on output so compiled files land at components/*/component.css as before
Add css/base/breakpoints.css to event_horizon.libraries.yml
Result: The build pipeline is PostCSS-only (autoprefixer + pxtorem). Source files are plain .css. No SCSS toolchain dependency remains.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mandclu created an issue. See original summary.

mherchel’s picture

Status: Active » Needs work

The way the breakpoints are converted is kinda weird.

This is the original Sass:

$sm: 'min-width: 500px';
$md: 'min-width: 700px';
$lg: 'min-width: 1000px';

/* Navigation related breakpoints */
$wide-nav: 'min-width: 1100px';
$mobile-nav: 'max-width: 1100px';

/* Grid related breakpoints */
$grid-md: 'min-width: 600px';
$grid-max: 'min-width: 1300px';

// Sponsor breakpoints
$grid-1-2: 'min-width: 600px';
$grid-2-3: 'min-width: 800px';
$label-format-switch:  'min-width: 1000px';

$hero_break: 'min-width: 700px';
/* Font sizes */

This is the current converted Sass:

+
43
−
0
html {
  --sm: small;
  --md: small;
  --lg: small;
  --wide-nav: small;
  --mobile-nav: large;
  --grid-md: small;
  --grid-max: small;
  --grid-1-2: small;
  --grid-2-3: small;
  --label-format-switch: small;

  @media (min-width: 31.25rem) {
    --sm: large;
  }
  @media (min-width: 43.75rem) {
    --md: large;
  }
  @media (min-width: 62.5rem) {
    --lg: large;
  }
  @media (min-width: 68.75rem) {
    --wide-nav: large;
  }
  @media (max-width: 68.75rem) {
    --mobile-nav: large;
  }
  @media (min-width: 37.5rem) {
    --grid-md: large;
  }
  @media (min-width: 81.25rem) {
    --grid-max: large;
  }
  @media (min-width: 37.5rem) {
    --grid-1-2: large;
  }
  @media (min-width: 50rem) {
    --grid-2-3: large;
  }
  @media (min-width: 62.5rem) {
    --label-format-switch: large;
  }
}

Something like this makes way more sense:

:root {
  --sm: false;
  @media (width >= 500px) {
    --sm: true;
  }

  --md: false;
  @media (width >= 700px) {
    --md: true;
  }

  --lg: false;
  @media (width >= 1000px) {
    --lg: true;
  }

/* Navigation related breakpoints */
  --wide-nav: false;
  @media (width >= 1100px) {
    --wide-nav: true;
  }

  --mobile-nav: false;
  @media (max-width: 1100px) {
    --mobile-nav: true;
  }

  /* Grid related breakpoints */
  --grid-md: false;
  @media (width >= 600px) {
    --grid-md: true;
  }

  --grid-max: false;
  @media (width >= 1300px) {
    --grid-max: true;
  }

  /* Sponsor breakpoints */
  --grid-1-2: false;
  @media (width >= 600px) {
    --grid-1-2: true;
  }

  --grid-2-3: false;
  @media (width >= 800px) {
    --grid-2-3: true;
  }

  --label-format-switch: false;
  @media (width >= 1000px) {
    --label-format-switch: true;
  }

  --hero-break: false;
  @media (width >= 700px) {
    --hero-break: true;
  }
}
mandclu’s picture

Status: Needs work » Needs review

@mherchel thanks for the feedback! This generally should be fixed now. One point is that stylelint throws a hissy fix if you mix the custom property declarations in with the @media at-rules, so they had to be kept at the top to keep the validation checks passing.

Also, as part of performing these updates, the AI updated the container syntax. For example:

BEFORE:    @container style(--md: large) {
AFTER:     @container style(--md: true) {

  • mandclu committed 5f116f13 on 2.0.x
    feat: #3604093 Replace dart-sass with PostCSS-only pipeline; migrate...
mandclu’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.