Uploaded image for project: 'E-commerce'
  1. E-commerce
  2. ECOMMERCE-418

Convert VAADIN/ecommerce/styles.css to scss file

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Neutral Neutral
    • 1.3
    • 1.3
    • None
    • Content Mngmt 6
    • 3

      To prevent the complexity of styling in css in the future

       DEV Note:

      1. Define scss file replace for current css
      2. Add maven plugin to build scss -> css, the css file will be placed in target
      3. Using @Stylesheet to include the new built css

      maven plugin:

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>groovy-maven-plugin</artifactId>
        <executions>
          <execution>
            <phase>process-resources</phase>
            <goals>
              <goal>execute</goal>
            </goals>
            <configuration>
              <source>
                import com.vaadin.sass.SassCompiler
                import java.util.regex.Matcher
      
                new File("${project.basedir}").eachFileRecurse {
                if (it.path =~ /\/target\/.*(\/VAADIN\/.*)(\/.*)\.scss$/) {
                def sassFile = it.path
                def cssPath = "${project.basedir}/target/classes"+Matcher.lastMatcher[0][1]
                def cssFile = cssPath + Matcher.lastMatcher[0][2]+".css"
                println "Compiling Sass file " + sassFile + " -&gt; " + cssFile
                new File(cssPath).mkdirs();
                SassCompiler.main([sassFile, cssFile] as String[])
                }
                }
              </source>
            </configuration>
          </execution>
        </executions>
      </plugin>
      

        Acceptance criteria

              thien.quach Quach Hao Thien
              thien.quach Quach Hao Thien
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Task DoD

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - 0d
                    0d
                    Logged:
                    Time Spent - 1d 7.5h
                    1d 7.5h