Drupal_add_css() strips everything between /* and */ signs

I'm trying to add inline CSS styles to <head> section using following PHP code:

$dynamic_style = ".wrapper  { width: 90%;} /* This is sample comment */"
drupal_add_css($data = $dynamic_styles, $options['type'] = 'inline', $options['preprocess'] = FALSE);

Unfortunately Drupal ignores anything between /* and */. This might look like a minor issue (comments for inline styles are not very useful), but real problems start when I wrap styles with CDATA section:

$dynamic_styles = "<!--/*--><![CDATA[/*><!--*/  .wrapper { width: 100%; }  /*]]>*/-->"
drupal_add_css($data = $dynamic_styles, $options['type'] = 'inline', $options['preprocess'] = FALSE);

In this case, the output will be:

<style>
<!--  .wrapper { width: 100%; }  -->  
</style>

instead of:

<style>
<!--/*--><![CDATA[/*><!--*/  .wrapper { width: 100%; }  /*]]>*/-->
</style>

which will result in missing styles and invalid markup.

Documentation says that if 'preprocess' option is set to TRUE, then inline styles "will be compressed when being output on the page". But it appears to me that styles are being compressed no matter whether $options['preprocess'] is set to TRUE or FALSE.

Drupal module to track user behavior?

Hi,

Is there any drupal module available to track the user behavior?

Drupal 7 Dev upgrade to full release?

Will the development release of Drupal 7 be able to be updated to the release version once it is out or will that version always be stuck in the development tree?

Currently I use Drupal 6 for my organization and I planned to do an entire redesign with Drupal 7. I would like to start on that project now so that I can release the site when the release of Drupal 7 comes.

forgot my password module?

I've searched the modules hoping to find one for remember my username/password.

Friendselectric problem

I have installed the Friendselectric theme on one of my sites, www.eugeneflinn.com . It looks fine in Firefox and Opera, but in IE it looks terrible. All the text is way too big, and depending on who's looking at it, either the content in the middle or the right column is pushed all the way down off the screen.

Multiple Users Editing the Same Page Concurrently?

We have an 'announcements' page for our school drupal website (at www.spiritwoodhs.lskysd.ca). I would like to be able to give multiple users the ability to add their own announcements to this page (to alleviate the workload on any one person).

Pages

Subscribe with RSS Subscribe to RSS - Drupal 7.x