Bump. It seems that there is still no simple method for including a stylus in php. Here is my workaround (linux only, local development only). This inspires my recent question about FAM .
install incron and stylus, under ubuntu it will be
sudo apt-get install incron sudo npm install stylus -g
Table of access to windows with the inscription
incrontab -e
and add the following suitable modifications:
/var/www/css/my.styl IN_MODIFY /usr/local/bin/stylus /var/www/css/my.styl
which basically means recompiling my.styl to my.css when changing the file.
add the resulting css to the html header
<link href="path/tom/my.css" rel="stylesheet" type="text/css" />
Whenever you save the .styl
file, your .css
will be recompiled in the background. Skip style file in deployment, use recompiled.
source share