Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
How to import theme SCSS files in portlet
hi 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?
build.gradle file add
buildCSS {
imports = [
new File(npmInstall.nodeModulesDir, "@clayui/css/src/scss")
]
}