I try to include specific LESS variables in my Modules' LESS stylesheet. Note: my module, not my theme.
For example have a file called app/code/Vendor/Module/view/frontend/web/css/stylesheet.less
. How can I use the parameters from lib/web/css/source/lib/variables/_layout.less
in this stylesheet (like @layout-indent__width
for example)?
Edit #1
I figured out I could do this like so:
@import '../../../../../../../../lib/web/css/source/lib/_variables.less';
@import '../../../../../../../../lib/web/css/source/lib/_responsive.less';
But somehow this doesn't look like the correct way to do this. Any suggestions on this?
Edit #2
I figured that including the LESS files like this would omit my variable overrides in my themes' _theme.less
. Since the stylesheet in question is located in var/view_preprocessed/css/frontend/ThemeVendor/ThemeName/en_US/Vendor_Module/css
I had to change the @import
-directives to:
@import '../../css/source/lib/_variables.less';
@import '../../css/source/_theme.less';
@import '../../css/source/lib/_responsive.less';
Still seems a bit quirky, but at least it works :-/
I'm still open for suggestions though. This solution doesn't look right to me.
Edit #3:
I stand corrected, none of the above works anymore. I knew it was unstable to start with. :-/ Any suggestions anyone?