peteboere / css-crush

CSS preprocessor.
http://the-echoplex.net/csscrush
MIT License
537 stars 51 forks source link

Global Vars #86

Closed blickwert closed 6 years ago

blickwert commented 6 years ago

I use CSS-Crush with multiple css-files and implement these files with the csscrush_tag in PHP. Currently I am including the same basic variables in every single CSS file with @import. Something unproductive ;-)

Is there a way to include a css-file with variables/fragments which can be used in all css files?

Thanks, David

blickwert commented 6 years ago

any suggestions?

blickwert commented 6 years ago

Am I the only one who has the problem? I clarify my problem again ;-) I have different css modules and load them over the csscrush_tag:

require_once 'path/to/CssCrush.php'; echo csscrush_tag('css/global_style.css', $options); echo csscrush_tag('css/modul_1/style.css', $options); echo csscrush_tag('css/modul_2/style.css', $options); echo csscrush_tag('css/modul_3/style.css', $options); echo csscrush_tag('css/modul_4/style.css', $options);

Now, i want to include to every css-modul the same basic vars/fragments. (maybe over the $options) I have a thought error or is this possibly a feature request?

peteboere commented 6 years ago

You can inject variables via the vars option. But not automatic includes. @import is the usual way to do what you want.

There is an import_path option in the master branch (3.x beta) which allows you to make importing from a library folder more straightforward.

blickwert commented 6 years ago

Hi Pete, thanks for your answer! Now I know my way around. Best regards