reuse project css less path folder hierarchy issue

简介: reuse project css less path folder hierarchy issue

Question

1580024800 - Internal Incident: Q2C/GM4: Issue in ‘Simulate sales pipeline’ app.

I ran into a bit of problem while implementing the fix, my local eclipse maven build will fail if I change library.source.less the way you suggested, cause base.less and global.less don’t exist there (…/…/…/…/sap/ui/core/themes/sap_bluecrystal/base.less, eclipse error message pasted below), I’m wondering if there’s any way the solution could work with both server side and local environment? Thanks again for your help.


Caused by: org.mozilla.javascript.JavaScriptException: Error importing file:

JavaException: java.io.IOException: File not found: sap/cus/crm/sap/ui/core/themes/sap_bluecrystal/base.less (less-api.js#146)


In order to illustrate my point, here’s a screenshot with remarks for your kindly information.


image.png


Answer

the path in your error message looks not correct.

I think you need to add 3 additional occurrences of “…/” to navigate to the correct directory.


If your directory is:


sap/cus/crm/lib/reuse/themes/sap_bluecrystal


Your need to reference the base.less / global.less files via:

image.png


Then the path should be correctly resolved.

The same goes for your base theme which should reference the less files from sap/ui/core/themes/base/.


Question

it worked locally ! will it work on the server as well? Let me find it out J


// this works

@import “…/…/…/…/…/…/…/sap/ui/core/themes/base/base.less”;


// this does not work, find can’t be found cause there’s no sap_bluecrystal folder in the local core

@import “…/…/…/…/…/…/…/sap/ui/core/themes/sap_bluecrystal/base.less”;


image.png

Answer

the core „sap_bluecrystal“ theme is part of the „themelib_sap_bluecrystal” artefact.

You need to add this dependency to your “pom.xml” file:

<dependency>
<groupId>com.sap.ui5</groupId>
<artifactId>themelib_sap_bluecrystal</artifactId>
<version>{Same version as for your other dependencies, e.g. core}</version>
</dependency>

solution

为reuse lib inject了sap_bluecrystal them的dependency

image.png


第三步,我们reuse的代码(src/sap/cus/crm/lib/reuse/themes/sap_bluecrystal/library.source.less)中,加入了sap_bluecrystal jar包里面base.less和global.less两个style的引用

// BEGIN: i314323 fix for incident 1580024800 (Q2C/GM4: Issue in 'Simulate sales pipeline' app)
@import "../../../../../../../sap/ui/core/themes/sap_bluecrystal/base.less";
@import "../../../../../../../sap/ui/core/themes/sap_bluecrystal/global.less";
// END: i314323 fix for incident 1580024800 (Q2C/GM4: Issue in 'Simulate sales pipeline' app)
相关文章
|
1月前
|
前端开发 JavaScript
webpack成长指北第7章---webpack的css\less\scss样式打包
webpack成长指北第7章---webpack的css\less\scss样式打包
42 0
|
22天前
|
敏捷开发 人工智能 前端开发
让你爽到飞起的【懒人插件AutoScssStruct4Vue】VSCode根据template的标签目录自动一键生成CSS/SCSS/LESS结构,敏捷开发必备插件!!!
让你爽到飞起的【懒人插件AutoScssStruct4Vue】VSCode根据template的标签目录自动一键生成CSS/SCSS/LESS结构,敏捷开发必备插件!!!
|
4月前
|
前端开发
解决VScode在保存less文件时,自动生成对应的css文件以及安装Easy less之后,计算式子不显示结果的问题
解决VScode在保存less文件时,自动生成对应的css文件以及安装Easy less之后,计算式子不显示结果的问题
|
22天前
|
前端开发 JavaScript
【实现js和css互通、共享常量参数值】js如何获取CSS/SCSS/LESS的常量、CSS/SCSS/LESS又是如何获取js的值(或者说js是如何主动推送参数给CSS使用的)?
【实现js和css互通、共享常量参数值】js如何获取CSS/SCSS/LESS的常量、CSS/SCSS/LESS又是如何获取js的值(或者说js是如何主动推送参数给CSS使用的)?
|
1天前
|
前端开发
【专栏】create-react-app 如何使用 less/sass 和 react-css-modules?
【4月更文挑战第29天】本文介绍了在 create-react-app 中集成 less/sass 预处理器和 react-css-modules 的方法。首先,通过 `npm` 安装 less 或 sass 依赖,然后修改 `config-overrides.js` 配置文件以支持 less/sass 编译。接着,详细阐述如何使用 less/sass 编写样式。再者,安装 react-css-modules 并配置 webpack,使能样式模块化。最后,展示了如何结合使用 less/sass 和 react-css-modules,以提升前端开发的效率和代码质量。
|
3月前
|
前端开发 JavaScript 编译器
CSS预处理器【Less】
CSS预处理器【Less】
55 0
|
8月前
|
前端开发
详细介绍less(css预处理语言)
详细介绍less(css预处理语言)
76 0
|
8月前
|
前端开发
CSS预处理器Sass和Less的使用指南(下)
CSS预处理器Sass和Less的使用指南(下)
|
8月前
|
资源调度 前端开发 JavaScript
CSS预处理器Sass和Less的使用指南(上)
CSS预处理器Sass和Less的使用指南(上)
103 0
|
8月前
|
前端开发 JavaScript
Vue 安装 CSS 预处理器(Less、Sass、Stylus)
Vue 安装 CSS 预处理器(Less、Sass、Stylus)
184 0