Skip to main content
better formulate question
Source Link
TVBZ
  • 213
  • 2
  • 12

I want to pass some variables to my css, without using inline styles. In myDuring some research I comefound different sources pointing to the same solution in different sources. For example here on the Joomla forum.

Basicly they explain how to use a php file as a stylesheet and incluse the php it like that:

<?php $document->addStyleSheet(.../my-custom-file.css.php'); ?>

I wonder ifIs this is good practice.? Should I do it like that or is there a better way provided by Joomla? Would this be able to cache? Would it be able to be combined and compressed by some other plugings for performance?

Any insights are most appreciated. Thanks!

I want to pass some variables to my css. In my research I come to the same solution in different sources. For example here on the Joomla forum.

Basicly they explain how to use a php file as a stylesheet and incluse the php it like that:

<?php $document->addStyleSheet(.../my-custom-file.css.php'); ?>

I wonder if this is good practice. Should I do it like that or is there a better way provided by Joomla? Would this be able to cache? Would it be able to be combined and compressed by some other plugings for performance?

Any insights are most appreciated. Thanks!

I want to pass some variables to my css, without using inline styles. During some research I found different sources pointing to the same solution. For example here on the Joomla forum.

Basicly they explain how to use a php file as a stylesheet and incluse the php it like that:

<?php $document->addStyleSheet(.../my-custom-file.css.php'); ?>

Is this good practice? Should I do it like that or is there a better way provided by Joomla? Would this be able to cache? Would it be able to be combined and compressed by some other plugings for performance?

Any insights are most appreciated. Thanks!

Source Link
TVBZ
  • 213
  • 2
  • 12

Pass PHP variables to CSS?

I want to pass some variables to my css. In my research I come to the same solution in different sources. For example here on the Joomla forum.

Basicly they explain how to use a php file as a stylesheet and incluse the php it like that:

<?php $document->addStyleSheet(.../my-custom-file.css.php'); ?>

I wonder if this is good practice. Should I do it like that or is there a better way provided by Joomla? Would this be able to cache? Would it be able to be combined and compressed by some other plugings for performance?

Any insights are most appreciated. Thanks!