-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a module system #1094
Comments
Wow, great job @JulienCabanes. |
In a way there is a plugin for import directory but since it's from Chris I'm pretty sure they know about it :p |
I really don't understand where do you get this from. I'd expect folder include to behave like this: // Import a single file
@import "file";
// Import all files from folder
@import "folder/*";
// Import all files from all folders from folder
@import "folder/**/*"; Or am I wrong? |
@hugogiraudel this came from #690 |
Why not both ? Use an index file if present, otherwise alphabetical ? |
@JulienCabanes & @hugogiraudel & @Anahkiasen : I love the suggestion made by @Anahkiasen. An alternate solution would be to have a different syntax depending on what you're loading:
Example code// Import a single file named "file"
@import "file";
// Import file "_index.scss" from folder "base"
@import "base/";
// Import all files from folder "base" in alphabetical order
@import "base/*";
// Import file "_index.scss" from every subfolder of folder "base",
// with folders loaded in alphabetical order
@import "base/*/";
// Import all files from every subfolder of folder "base"
// with both folders and files loaded in alphabetical order
@import "base/*/*"; |
Convention is to use |
I'm not familiar with that convention, but it's but a minor difference... // Import a single file named "file"
@import "file";
// Import file "_index.scss" from folder "base"
@import "base/";
// Import all files from folder "base" in alphabetical order
@import "base/*";
// Import file "_index.scss" from every subfolder of folder "base",
// with folders loaded in alphabetical order
@import "base/**/";
// Import all files from every subfolder of folder "base"
// with both folders and files loaded in alphabetical order
@import "base/**/*"; |
@Anahkiasen I would just do the alphabetical import, without the automatic check for the |
This sort of falls under the conditional imports #451, but slighlty different use case: Currently trying to declare What I am trying to do is following:
This would be a great way to enforce "namespaced" styles for the components (in my case, Angular directives which live in their own separate folders with their javascripts, templates, tests and styles), and also allow nice short syntax (that |
@robwierzbowski a css placeholder can be defined with %class-name {
color: red;
}
.module {
@extend %class-name;
} |
I hav to agree with @aripalo: Some sort of |
+1 for Paths via variables but specially via something @require-like. Having aliases for css module partials would be awesome. Implementing a An addition to the idea is to have a keyword pointing to project root folder, for example:
This way we leave sass to resolve the root folder path (as some projects are run in multiple OSes so Windows is C:/ but Mac ~/ and so on) and also because sometimes we want to import one single file - without making a full path alias for it - and having |
Hello, I would like to know where is the current development state of these features ? Especially for a feature like this in less : http://lesscss.org/features/#import-options => @import (reference) "filename"; Thank you. |
See sass/sass#1094 See #554
See sass/sass#1094 See #554
See sass/sass#1094 See #554
See sass/sass#1094 See #554
Trying to follow the issues to get an understanding where this is, in regards to libSass, it was tagged libsass4.0 and is now tagged 5.0, considering 4.0 has a release goal for 2021, are we not expecting this until after then? |
Closing this out because LibSass is now deprecated and we aren't expecting to add any additional features to it. |
See also the module system project.
This is a compilation of issues and wishes about @import
Import CSS files #556
Would import sass, scss or css file
Import Once #139
Multiple syntax suggestions for one time import
Import Directory #690
@import "foo";
If "foo" is a folder than it tries to import "foo/_module.scss"
Namespaces and Aliases #353
This would put every "foo" components (mixins, vars, placeholders...) in a "bar" package.
What would be the separator ?
.
or/
or\
or::
?Where would go the
$
and%
? Before or after the namespace ?What it would look like :
Non-transitive imports #353
Renaming classes #353
Disabling CSS output #353
This is also related to #320 :
B output would not contain
.foo
&.bar
definition but only.baz
;Conditional imports #451
It "worked" before but never intended.
Paths
A way to setup shortcut paths (like Require.js)
The text was updated successfully, but these errors were encountered: