Skip to content

Revert to Base folder with partials

Compare
Choose a tag to compare
@sebastiano-guerriero sebastiano-guerriero released this 08 Jun 12:58

We've been listening to the feedback we've received following the release of version 2.7.0 ("Simplified Framework Structure"). We've tested the option of importing specific (base) partials, but our solution didn't work with the new SASS Module System if the _base.scss is imported multiple times within the same file.

We've decided to bring back the Base folder with the partials.

If you're using the $cody-base-partials variable introduced in v2.7.1 to import specific partials, it still works. However, we suggest importing directly the partials because this variable will be deprecated in v3.0.

// ⚠️  it still works
$cody-base-partials: 'breakpoints', 'mixins';
@import 'base';

// ✅ better solution
@import '~codyhouse-framework/main/assets/css/base/breakpoints';
@import '~codyhouse-framework/main/assets/css/base/mixins';

However, if you're using the new SASS modules, you can't update the variable using the "with" configuration:

// ❌ this won't work
@use 'base' as * with (
  $cody-base-partials: 'breakpoints' 'mixins',
);

// ✅ this works
@use '~codyhouse-framework/main/assets/css/base/breakpoints' as *;
@use '~codyhouse-framework/main/assets/css/base/mixins' as *;