【问题标题】:Vaadin cannot find my theme filesVaadin 找不到我的主题文件
【发布时间】:2017-09-16 05:14:09
【问题描述】:

当我遇到这个错误时,我只是想做正常的事情

INFO: Requested resource [/VAADIN/themes/mytheme/styles.css] not found from filesystem or through class loader. Add widgetset and/or theme JAR to your classpath or add files to WebContent/VAADIN folder.

这是我的styles.css

我的addons.scss

/* This file is automatically managed and will be overwritten from time to time. */
/* Do not manually edit this file. */

/* Import and include this mixin into your project theme to include the addon themes */
@mixin addons {
}

我的styles.scss

@import "mytheme.scss";
@import "addons.scss";

// This file prefixes all rules with the theme name to avoid causing conflicts with other themes.
// The actual styles should be defined in mytheme.scss

.mytheme {
  @include addons;
  @include mytheme;

}

我的mytheme.scss

// If you edit this file you need to compile the theme. See README.md for details.

// Global variable overrides. Must be declared before importing Valo.

// Defines the plaintext font size, weight and family. Font size affects general component sizing.
//$v-font-size: 16px;
//$v-font-weight: 300;
//$v-font-family: "Open Sans", sans-serif;

// Defines the border used by all components.
//$v-border: 1px solid (v-shade 0.7);
//$v-border-radius: 4px;

// Affects the color of some component elements, e.g Button, Panel title, etc
//$v-background-color: hsl(210, 0%, 98%);
// Affects the color of content areas, e.g  Panel and Window content, TextField input etc
//$v-app-background-color: $v-background-color;

// Affects the visual appearance of all components
//$v-gradient: v-linear 8%;
//$v-bevel-depth: 30%;
//$v-shadow-opacity: 5%;

// Defines colors for indicating status (focus, success, failure)
//$v-focus-color: valo-focus-color(); // Calculates a suitable color automatically
//$v-friendly-color: #2c9720;
//$v-error-indicator-color: #ed473b;

// For more information, see: https://vaadin.com/book/-/page/themes.valo.html
// Example variants can be copy/pasted from https://vaadin.com/wiki/-/wiki/Main/Valo+Examples

@import "../valo/valo.scss";

@mixin mytheme {
  @include valo;

  // Insert your own theme rules here
}

哦,我正在使用 Eclipse,所以 Vaadin can't find my themes 不会有帮助 谢谢

【问题讨论】:

  • 您的mytheme.css 包含SASS?或者你的意思是你的mytheme.scss
  • 我的意思是 mytheme.scss
  • 我不知道这是否有区别,但请尝试导入行@import "../valo/valo";
  • 您确定丢失的 css 文件存在于正确的位置(或者可以动态生成,因此包含主题编译器)?或者可能没有正确配置(servlet)过滤器?顺便说一句,你的 scss 文件没问题

标签: java css sass vaadin vaadin8


【解决方案1】:

我已经通过运行找到了自己的答案

mvn package jetty:run

而不是

mvn jetty:run

重置 vaadins 样式

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-04-30
    • 2013-05-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-02-27
    • 1970-01-01
    • 2016-07-14
    相关资源
    最近更新 更多