question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to remove dependency on another file?

See original GitHub issue

The project suggests that the user will be able to change the design of the blocks without editing the core of the module. That’s how it works on IMPORT. Simple and understandable, as in any programming language.

##### You can edit files
// design1.scss
$a: red;

// design2.scss
$a: green;

// style.scss 
@import 'design1';
// or
// @import 'design2';

@import 'core';


##### You can not edit
// core.scss
.d { color: $a }

With using USE, it is necessary to explicitly prescribe a module with variables in the core of the module. This creates dependence on another file and does not allow them to manage.

# You can edit files #
// style.scss 
@use 'design1';
// or
// @use 'design2';

@use 'core';


# You can not edit #
// core.scss
@use 'design1' as design; // !!! incorrect - depends on another file !!!

.d { color: design.$a }

How to make the user change the design only in the style.scss file? Without editing the core.scss file.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
maxsitecommented, Feb 24, 2021

The problem is that IMPORT does not interfere with anyone and works without any problems. USE creates its scope that is not always needed by developers. In other programming languages, if you need an area of ​​visibility, it sets where it is in demand.

The main goal is convenience for users. For example, in my projects there are more than 50 variables that are easily overlapped through the IMPORT in two lines of code. With USE is impossible to do this.

Maybe you should consider the opinion of those who use Sass in their projects? And not to close inconvenient ticket? If you really want modularity in Sass, it may be worth making instructions for a global scope as it works now?

Sorry for GoogleTranslate

0reactions
sKopheKcommented, May 6, 2021

hi, got stuck with scoped @imports and also am not sure about migrating bourbon library

Read more comments on GitHub >

github_iconTop Results From Across the Web

Remove file from dependency jar using maven - Stack Overflow
unzip the war in a temp directory · unzip the dependency in another temp directory · delete the file from the dependency ·...
Read more >
To Remove File Dependencies
Right-click the dependent child file and select Unlink Dependency. When the Remove Dependent File Link dialog opens, click Yes. The file dependency is...
Read more >
How to: Create and remove project dependencies - Visual ...
To remove dependencies from projects · In Solution Explorer, select a project. · On the Project menu, choose Project Dependencies. · On the ......
Read more >
Uninstalling packages and dependencies - npm Docs
To remove a package from your node_modules directory, on the command line, use the uninstall command. Include the scope if the package is...
Read more >
Removing Dependencies: One Weird Trick for Increasing ...
Code in an unmaintained dependency may either stop compiling or, more often, cause compilation warnings because of deprecations. These ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found