gpt4 book ai didi

css - SASS 无效的 CSS

转载 作者:太空宇宙 更新时间:2023-11-04 13:07:00 24 4
gpt4 key购买 nike

我正在尝试用 compass 编译一些 scss 但我收到错误

error portal/forms.scss (Line 104: Invalid CSS after " width: ": 
expected expression (e.g. 1px, bold), was "@model_hints_co...")

对于代码:

.lfr-input-resource {
width: @model_hints_constants_text_display_width@px;
}

代码来自liferay门户源码:https://github.com/liferay/liferay-portal/blob/b45e6646b18809abf13ddfb60d1d6566e22a8f8c/portal-web/docroot/html/css/portal/forms.css

而且我不知道 @model_hints_constants_text_display_width@px; 是什么。

最佳答案

您必须将此变量更改为您的自定义宽度值。

我已经调查过了,我发现 liferay 有一个函数可以将这个标记替换为另一个值:

        public static String parseStaticTokens(String content) {
return StringUtil.replace(
content,
new String[] {
"@model_hints_constants_text_display_height@",
"@model_hints_constants_text_display_width@",
"@model_hints_constants_textarea_display_height@",
"@model_hints_constants_textarea_display_width@"
},
new String[] {
ModelHintsConstants.TEXT_DISPLAY_HEIGHT,
ModelHintsConstants.TEXT_DISPLAY_WIDTH,
ModelHintsConstants.TEXTAREA_DISPLAY_HEIGHT,
ModelHintsConstants.TEXTAREA_DISPLAY_WIDTH
});
}

例如,您应该将宽度设为 100px:

.lfr-input-resource {
width: 100px;
}

希望对您有所帮助。

问候。

关于css - SASS 无效的 CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25050548/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com