Message Boards
How to import theme SCSS files in portlet
sunny huang, modified 3 Years ago.
How to import theme SCSS files in portlet
Junior Member Posts: 56 Join Date: 1/17/11 Recent Postshi all
I copied the source code of the document-library-web portlet, and an error was reported during buildCSS. the file was not found. This file should be the default SCSS file fo liferay theme. How do I import it?
ERROR
> Task :modules:document-library-web:buildCSS FAILED
Using native Sass compiler
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "main" com.liferay.sass.compiler.jsass.internal.JSassCompilerException: io.bit3.jsass.CompilationException: Error: File to import not found or unreadable: atlas-variables.
on line 1 of build/tmp/copyCSS/META-INF/resources/document_library/css/ddm.scss
>> @import 'atlas-variables';
^
at com.liferay.sass.compiler.jsass.internal.JSassCompiler.compileFile(JSassCompiler.java:134)
at com.liferay.css.builder.CSSBuilder._parseSass(CSSBuilder.java:395)
at com.liferay.css.builder.CSSBuilder._parseSassFile(CSSBuilder.java:407)
at com.liferay.css.builder.CSSBuilder.execute(CSSBuilder.java:166)
at com.liferay.css.builder.CSSBuilder.main(CSSBuilder.java:80)
Caused by: io.bit3.jsass.CompilationException: Error: File to import not found or unreadable: atlas-variables.
on line 1 of build/tmp/copyCSS/META-INF/resources/document_library/css/ddm.scss
>> @import 'atlas-variables';
^
at io.bit3.jsass.adapter.NativeAdapter.compileFile(Native Method)
at io.bit3.jsass.adapter.NativeAdapter.compile(NativeAdapter.java:44)
at io.bit3.jsass.Compiler.compile(Compiler.java:124)
at com.liferay.sass.compiler.jsass.internal.JSassCompiler.compileFile(JSassCompiler.java:115)
... 4 more
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':modules:document-library-web:buildCSS'.
How does a portlet automatically load SCSS files through dependencies?
sunny huang, modified 3 Years ago.
RE: How to import theme SCSS files in portlet (Answer)
Junior Member Posts: 56 Join Date: 1/17/11 Recent Postsbuild.gradle file add
buildCSS {
imports = [
new File(npmInstall.nodeModulesDir, "@clayui/css/src/scss")
]
}