vaadin / sass-compiler

A Java Sass compiler implementation
53 stars 25 forks source link

Provide a way to know if Valo theme is in use #293

Open vaadin-bot opened 9 years ago

vaadin-bot commented 9 years ago

Originally by @tepi


When building an addon theme, it would be useful to know if Valo is the base theme so one could use valo variables. However there's no reasonable way to do this since the compiler does not support variable-exists, function-exists etc.

A workaround I did for Spreadsheet goes like this but is far from pretty:

$v-color-keywords: non-valo-theme !default;

@mixin spreadsheet {

    // Very nice workaround for missing variable-exists function
    @if $v-color-keywords == non-valo-theme {
        @include spreadsheet-legacy;
    } @else {
        @include spreadsheet-valo;
    } 

}

Imported from https://dev.vaadin.com/ issue #17193