Bladeren bron

Update themes-compiling.asciidoc.

Adding tip about non-compiling theme, re-phrased other on-the-fly compilation
instructions.

Change-Id: I196235823ba95723e3a7436c075cb7e9ee9951be
tags/7.7.0.alpha1
Matti Tahvonen 8 jaren geleden
bovenliggende
commit
c317e6005b
1 gewijzigde bestanden met toevoegingen van 12 en 12 verwijderingen
  1. 12
    12
      documentation/themes/themes-compiling.asciidoc

+ 12
- 12
documentation/themes/themes-compiling.asciidoc Bestand weergeven

[[themes.compiling.on-the-fly]] [[themes.compiling.on-the-fly]]
== Compiling On the Fly == Compiling On the Fly


The easiest way to use Sass themes during theme development is to let the Vaadin
servlet compile them on the run. In this case, the SCSS source files are placed
in the theme folder. Compilation is done each time the [filename]#styles.css# is
requested from the server.
The easiest way to develop Sass themes is to compile them at runtime, when the page is loaded.
The Vaadin servlet does this automatically if a compiled theme CSS file is not found from the theme folder.
You need to have the SCSS source files placed in the theme folder.
The theme is compiled when the [filename]#styles.css# is first requested from the server.
If you edit the Sass theme, it is recompiled the next time you reload the page.


The on-the-fly compilation takes a bit time, so it is only available when the The on-the-fly compilation takes a bit time, so it is only available when the
Vaadin servlet is in the development mode, as described in Vaadin servlet is in the development mode, as described in
all its dependencies to be in the class path of the servlet. At least for all its dependencies to be in the class path of the servlet. At least for
production, you must compile the theme to CSS, as described next. production, you must compile the theme to CSS, as described next.


NOTE: If the on-the-fly compilation does not seem to work, ensure that your build script has not generated a pre-compiled CSS file.
If [filename]#styles.css# file is found the servlet, the compilation is skipped.
Delete such an existing [filename]#styles.css# file and disable theme compilation temporarily.


[[themes.compiling.eclipse]] [[themes.compiling.eclipse]]
== Compiling in Eclipse == Compiling in Eclipse
<property name="src-location" value="src" /> <property name="src-location" value="src" />


... other project build definitions ... ... other project build definitions ...
<!-- Name of the theme --> <!-- Name of the theme -->
<property name="theme" value="book-examples"/> <property name="theme" value="book-examples"/>
<!-- Compilation result directory --> <!-- Compilation result directory -->
<property name="result" value="build/result"/> <property name="result" value="build/result"/>
</target> </target>
<path id="compile.classpath"> <path id="compile.classpath">
<!-- Source code to be compiled --> <!-- Source code to be compiled -->
<pathelement path="${src-location}" /> <pathelement path="${src-location}" />
<!-- Vaadin libraries and dependencies --> <!-- Vaadin libraries and dependencies -->
<fileset dir="${result}/lib"> <fileset dir="${result}/lib">
<include name="*.jar"/> <include name="*.jar"/>
depends="init, resolve"> depends="init, resolve">
<delete dir="${result}/VAADIN/themes/${theme}"/> <delete dir="${result}/VAADIN/themes/${theme}"/>
<mkdir dir="${result}/VAADIN/themes/${theme}"/> <mkdir dir="${result}/VAADIN/themes/${theme}"/>
<java classname="com.vaadin.sass.SassCompiler" <java classname="com.vaadin.sass.SassCompiler"
fork="true"> fork="true">
<classpath> <classpath>
</target> </target>
</project> </project>
---- ----





Laden…
Annuleren
Opslaan