2014-10-14 2 views
0

"valo"라는 새로운 Vaadin 테마를 사용하려고합니다. 그래서Vaadin 테마 : java.lang.Exception : Mixin 정의 : valo 찾을 수 없음

만약 angel/테마/기본/styles.scss

$v-background-color: hsl(200, 50%, 50%); 

@import "../valo/valo"; 

.default { 
    @include valo; 
} 

을 (공식 문서에 설명 된대로)이 파일을 생성하지만 받는다는와 응용 프로그램 컴파일하려고하면

[INFO] --- vaadin-maven-plugin:7.3.2:compile-theme (default) @ de.balindoo.theme.balindoo --- 
[INFO] Updating theme VAADIN\themes\default 
[ERROR] java.lang.Exception: Mixin Definition: valo not found 
[ERROR]  at com.vaadin.sass.internal.visitor.MixinNodeHandler.replaceMixins(MixinNodeHandler.java:40) 
[ERROR]  at com.vaadin.sass.internal.visitor.MixinNodeHandler.traverse(MixinNodeHandler.java:33) 
[ERROR]  at com.vaadin.sass.internal.tree.MixinNode.traverse(MixinNode.java:117) 
[ERROR]  at com.vaadin.sass.internal.ScssStylesheet.traverse(ScssStylesheet.java:271) 
[ERROR]  at com.vaadin.sass.internal.ScssStylesheet.traverse(ScssStylesheet.java:280) 
[ERROR]  at com.vaadin.sass.internal.ScssStylesheet.traverse(ScssStylesheet.java:280) 
[ERROR]  at com.vaadin.sass.internal.ScssStylesheet.compile(ScssStylesheet.java:187) 
[ERROR]  at com.vaadin.sass.SassCompiler.main(SassCompiler.java:57) 
[INFO] Theme "VAADIN\themes\default" compiled 

내가 뭘 잘못하고 있니? 만약 angel-테마-7.3.2 패키지는 의존성에 추가되고 또한 예상대로 테마가 작동 순록 다시 전환 내 pom.xml 파일

<plugin> 
    <groupId>com.vaadin</groupId> 
    <artifactId>vaadin-maven-plugin</artifactId> 
    <version>${version.vaadin.plugin}</version> 
    <configuration> 
    <extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs> 
    <noServer>true</noServer> 
    <webappDirectory>${basedir}/src/main/webapp/VAADIN/widgetsets</webappDirectory> 
    <hostedWebapp>${basedir}/src/main/webapp/VAADIN/widgetsets</hostedWebapp> 
    <!-- Remove draftCompile when project is ready --> 
    <draftCompile>false</draftCompile> 
    <compileReport>true</compileReport> 
    <style>OBF</style> 
    <strict>true</strict> 
    </configuration> 
    <executions> 
    <execution> 
     <goals> 
     <!--<goal>clean</goal>--> 
     <goal>resources</goal> 
     <goal>update-widgetset</goal> 
     <goal>compile</goal> 
     <goal>update-theme</goal> 
     <goal>compile-theme</goal> 
     </goals> 
    </execution> 
    </executions> 
</plugin> 

의 빌드 섹션에서 다음과 같은 플러그인을 추가했다. 난 당신이 단지 테마 발로에 구축하거나 자신 만의 테마를 확장 사용하려는 모르겠어요

+0

당신은 vaadin-themes-7.3.2가 있고 vaadin-sass-compiler-0.9.10도 거기에 있다는 것이 긍정적입니까? 그리고 퀴어 deps에 의해 일부 이전 버전? – cfrick

+0

나는 내 의존성을 들여다 보았다. 두 패키지 (vaadin-themes 및 vaadin-sass-compiler)의 올바른 버전은 – vralfy

+0

입니다. styles.css의 이름을 styles.scss로 변경하면 어떻게됩니까? – Krayo

답변

0

방금 ​​전체 빌드를 복사했습니다. 이 POM 파일에서 ection : 모든 것이

1

...

앱에서 발로 테마를 사용하려는 경우 작성할 필요가 없습니다 SCS들 당신의 UI 클래스에 @theme 주석을 추가

@Theme("valo") 
@SuppressWarnings("serial") 
public class MyVaadinUI extends UI 
{..... 

당신이 만약 angel \ 테마 디렉토리에서 자신의 테마 폴더를 만들려면 에있는 발로 테마를 확장 자신의 테마 (라는 이름의 예 mytheme)를 쓸 계획하는 경우 :

src\main\webapp\VAADIN\themes\mytheme 
그 디렉토리에개

및 쓰기 파일 :

mytheme.scss

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

// Defines the plaintext font size, weight and family...... 
//$v-font-size: 16px; 
//$v-font-family: "Open Sans", sans-serif; 


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

@mixin mytheme { 
    @include valo; 
    // Insert your own theme rules here 
} 

BTW

@import "addons.scss"; 
@import "mytheme.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 theme styles in your theme 
    @include mytheme; 
} 

styles.scss : 당신은 테마

작업 angel이라는 응용 프로그램 프로젝트를 만들 받는다는 전형을 사용할 수 있습니다
mvn archetype:generate -DarchetypeGroupId=com.vaadin -DarchetypeArtifactId=vaadin-archetype- application -DarchetypeVersion=7.3.2 -Dpackaging=war 
+1

나는이 해결책이 잘못되었다고 생각합니다. Vaadin 문서에 따르면 다른 방법으로 작성해야합니다. 나는 그것을 썼다 (쓰여진대로 모방). 나는 성공하지 못했다. 컴파일러에서 오류가 발생합니다. – hariprasad

0

잘 작동 https://github.com/vaadin/valo-demo/blob/master/pom.xml

후에 내가 가져

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

을 사용하고 있는데 그게 잘 작동합니다. 나는 .scss 확장이 이론적으로 선택 사항이어야한다고 생각하지만, Vaadin의 SCSS 컴파일러가 필요로하는지 여부는 확실하지 않습니다.

관련 문제