vaadin / sass-compiler

A Java Sass compiler implementation
53 stars 25 forks source link

Static java fields in style sheets #37

Open vaadin-bot opened 12 years ago

vaadin-bot commented 12 years ago

Originally by @tomivirkki


Having to maintain style names both in your project's style sheet files and your java code is annoying. Style names are often declared as static final fields in your classes but you still need to update your css/sass files manually whenever changes to the style names occur. It would be nice to be able use the same static resources in your style sheets as well so you'd only need to change their values in one place. The project class files can be accessed with the classloader of the servlet that provides the compiled sass/css files so this should be doable.

Example:

main-view .[com.vaadin.project.component.STYLE_NEW] {

color: #fff;

}


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

vaadin-bot commented 9 years ago

Originally by @jouni


If this is ever implemented, it should be done so that it won't break the Ruby Sass compiler, but instead allow proving a fallback value for the constants.