API page: http://api.drupal.org/api/drupal/includes--common.inc/function/drupal_ad...

Describe the problem you have found:

I had no clue what "Type" module versus theme meant until it was stated in IRC that "Module CSS files come first, so theme CSS can override them"

It then made perfect sense that the Designer could overrule my not-so-good-but-okay styles in the theme, while we limped along with the crude basic module version.

Maybe that one line would help somebody else...

I'm just sayin'...

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhodgdon’s picture

Title: Documentation problem with drupal_add_css » drupal_add_css should reference drupal_get_css()
Issue tags: +Novice

I don't see a problem with the documentation here. For $type, it says currently:
$type (optional) The type of stylesheet that is being added. Types are: module or theme.
So it does say it is module or theme, and I am not sure what the confusion is about -- wouldn't you know whether you are calling drupal_add_css() from a module or theme?

http://api.drupal.org/api/drupal/includes--common.inc/function/drupal_ge...
This is the function that builds up the CSS lines to put in the HTML page head. That function documents that it puts the module CSS before the theme CSS. drupal_add_css() doesn't really have any role in that process -- it just builds up a list of what needs to be added.

I guess we could put @see drupal_get_css() in the drupal_add_css() doc (and perhaps vice versa). Good project for a novice doc contributor.

barbi’s picture

Assigned: Unassigned » barbi
Status: Active » Needs review
FileSize
716 bytes

Added @see in both the functions - referencing each other.

mr.baileys’s picture

Version: 6.x-dev » 8.x-dev

Looks good to me, although while we are working on the docs for these functions, can we also add a blank line before the @return directive (see Doxygen and comments formatting conventions)?

Additionally, we'll need to fix this in D8/D7 first and then backport to D6... @barbi, would you mind rolling the patches for D7/D8 too?

jhodgdon’s picture

Status: Needs review » Patch (to be ported)

Thanks mr.baileys -- I didn't notice this was D6 in the original report! Definitely needs fixing in D8/7 first.

RobLoach’s picture

Category: feature » task
Status: Patch (to be ported) » Needs review
Issue tags: +Needs backport to D7
FileSize
862 bytes
jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

That looks good! Please commit to d8/7 and then mark as patch/to be ported for d6.

webchick’s picture

Status: Reviewed & tested by the community » Patch (to be ported)
Issue tags: -Needs backport to D7 +Needs backport to D6

Committed to 8.x and 7.x. Thanks!

Marking back to 6.x, to be ported.

TR’s picture

Version: 8.x-dev » 6.x-dev
Assigned: barbi » Unassigned
Status: Patch (to be ported) » Needs review
FileSize
900 bytes

Here's the D6 backport.

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Thanks!

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thank you.

Status: Fixed » Closed (fixed)
Issue tags: -Needs backport to D6, -Novice

Automatically closed -- issue fixed for 2 weeks with no activity.