redux-framework icon indicating copy to clipboard operation
redux-framework copied to clipboard

Dynamic SCSS

Open Jim-E opened this issue 12 years ago • 5 comments

I've been trying out https://github.com/sanchothefat/wp-sass It seems to work pretty well and you can use php variables.

.site-title {
font-family:<?php echo $redux_demo['opt-typography']['font-family']; ?>;
font-weight:<?php echo $redux_demo['opt-typography']['font-weight']; ?>;
font-style:<?php echo $redux_demo['opt-typography']['font-style']; ?>;
...
}

Just wondering if anyone has a better idea/way? I'm not sure how active the development is on: https://github.com/sanchothefat/wp-sass

Thanks

Jim-E avatar Jul 01 '14 00:07 Jim-E

https://github.com/panique/php-sass-watcher is something I am planning to use for my own theme. It uses http://leafo.net/scssphp/, the best PHP version out there.

Good luck!

dovy avatar Jul 01 '14 00:07 dovy

I was trying out https://github.com/ConnectThink/WP-SCSS works great as just a compiler

I would like to get Redux values from the database to use in an .scss or .scss.php file.

I'll take a look at sass-watcher but at a glance it looks like just a basic timed compiler.

Thanks

Jim-E avatar Jul 01 '14 00:07 Jim-E

I used the code you mentioned. The customizer dies at it's hands. Otherwise it was a good starting point.

The PHP Scss stuff doesn't work that well especially with mix-ins. I think I am going to separate out the stuff I want custom and only compile that. It was too painful. hah.

Right now the new class I mentioned is just running indefinitely. BOO. heh.

dovy avatar Jul 01 '14 00:07 dovy

IE, LESS is much easier, but I love SCSS. So I have to find a way. :-/

dovy avatar Jul 01 '14 00:07 dovy

LESS would be fine too, maybe I'm barking up the wrong tree but I really want to be able to use values from the database. Think of the possibilities, a very simple example the user could pick a main background color for say a button and borders and text color could be automatically set via lighten/darken/saturation/opacify etc.

WP-SCSS detects change so I would think something must be running there too, pinging for changes?

I did read that one guy uses wp-less that is similar: http://themeforest.net/forums/thread/is-less-compiler-allowed-in-themes/125362?page=2

If you come up with any ideas let me know.

Thanks

Jim-E avatar Jul 01 '14 00:07 Jim-E