-
Notifications
You must be signed in to change notification settings - Fork 9.4k
No way for an extension to import a standard Less file because the reverse paths (../) in Less @import statements are forbidden for the extensions #2264
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
Comments
Any news on this issue? Is it possible to include core standard less files into our custom module. I am having the same problem as well. File path '../../source/lib/_responsive.less' is forbidden for security reasons. |
internal ticket MAGETWO-48840 created |
First, yes - this needs fixing in M2. I think there is a workaround if you are using Grunt/Gulp (not our built in tool chain) if you want to experiement. I think if you declare a variable holding the path name then put that variable into the import path name ( We are considering options such as having a "Lib::" prefix to go back to the root so you could |
Hi, I'm having a similar problem when trying to use a LESS file from the
Now, I could use Bootstrap compiled CSS, but that wouldn't allow me to use variables and mixins from that deployment. If I try to copy Bootstrap files directly in the theme web directory, then the LESS preprocessor will pick them up and fail, since it tries to compile every file in the Bootstrap library instead of just the main one (which imports the other ones). (And also, it's better to keep external CSS libraries in the The error shown is the same as described above:
I tried to symlink the file (which is not always the best solution since some deployments may fail to reproduce symlinks adequately, especially on Windows), but it's not working either. I'll probably have to copy the full Bootstrap code in a file as a workaround, but it's more maintainable to enable some way of importing from vendor/ directory. Any other suggestions? |
Hi @leoquijano. You're correct. There is no possibility to import files from vendor directory. via ././ to cover current case If importing files from vendor directory still valuable case for you, please create new issue. |
…ery-From-Stage Fixing Unable to create folder in media gallery
The problem is similar to #2179
#2179 is not actually a problem because of the solution I found and described there.
But when an extension need to import a standard Magento 2 Less file the solution will not help because of the folder structure:
var\view_preprocessed\css\adminhtml\Magento\backend\en_US
:--------
css
--------
Custom_Extenson
So the
Custom_Extenson
can not @import a Less file from thecss
folder (this is the folder with standard Magento 2 less files) as it can not use reverse paths.The text was updated successfully, but these errors were encountered: