Skip to content

Commit

Permalink
fix: @use imports
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkh committed Jan 8, 2025
1 parent dcccd1c commit 96f2dcd
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions src/scss/vendors/_lineup.scss
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
// With https://github.com/lineupjs/lineupengine/releases/tag/v2.5.3, they changed from @import to @use, forcing us to use the variables before being able to override them.
@use 'lineupengine/src/styles/vars' as *;
@use 'lineupengine/src/styles/vars' as * with (
// TODO: Without this, we get "Can't resolve './node_modules/lineupengine/src/styles/lineupengine/src/assets/loading.svg' in '.../workspaces/<repo>'"
// Why do I need to do this? Probably because lineupjs defines $engine_assets and it is resolving it relatively?
$engine_assets: '../assets',
$engine_loading_image: url('../assets/loading.svg'),
$engine_loading_static_image: url('../assets/loading_s.svg')
);

// TODO: Without this, we get "Can't resolve './node_modules/lineupengine/src/styles/lineupengine/src/assets/loading.svg' in '.../workspaces/<repo>'"
// Why do I need to do this? Probably because lineupjs defines $engine_assets and it is resolving it relatively?
$engine_assets: '../assets';
$engine_loading_image: url('#{$engine_assets}/loading.svg');
$engine_loading_static_image: url('#{$engine_assets}/loading_s.svg');

$lu_assets: '../assets' !default;
$lu_use_font_awesome: true !default;
$lu_include_font_awesome: false !default;
@use 'lineupjs/src/styles/vars' as * with (
$lu_assets: '../assets',
$lu_use_font_awesome: true,
$lu_include_font_awesome: false
);

// Add fontawesome only here to allow lazy loading of this style.
@import '@fortawesome/fontawesome-free/scss/solid';
@import '@fortawesome/fontawesome-free/scss/regular';
@import '@fortawesome/fontawesome-free/scss/brands';
@import '@fortawesome/fontawesome-free/scss/fontawesome';

@import 'lineupjs/src/style.scss';
@import 'lineupjs/src/styles/lineup.scss';

.lu {
// use a fixed font-size for the ranking + side panel with the Roboto font family.
Expand Down Expand Up @@ -63,4 +65,4 @@ $lu_include_font_awesome: false !default;
mask-position: center;
mask-repeat: no-repeat;
font-size: inherit;
}
}

0 comments on commit 96f2dcd

Please sign in to comment.