Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I love the new CSS class for views, however, when I try to add the class "grid_16" which is from my 960 grid system CSS file, I get the error "CSS classes must be alphanumeric or dashes only."
I think it's okay to have underscores in class names, right?
For now, I just added grid16 to my class, but I think this should be addressed if it's an easy fix.
Comment | File | Size | Author |
---|---|---|---|
#8 | 939992-css-underscore.patch | 617 bytes | dawehner |
Comments
Comment #1
dawehnerthe myth that underscores are not allowed seems to be wrong: see http://devedge-temp.mozilla.org/viewsource/2001/css-underscores/ and http://stackoverflow.com/questions/448981/what-characters-are-valid-in-c...
Comment #2
dagmarThere is no patch to review here.
Comment #3
dawehnerregular expressions :)
Comment #4
lukus+1 for underscores
Comment #5
pinch' CreditAttribution: pinch' commented+1 for underscores
Comment #6
wanjee CreditAttribution: wanjee commented+1 for underscores
Comment #7
Jej CreditAttribution: Jej commented+1 for underscores but also for spaces (left as spaces and not dashed)
Comment #8
dawehnerHere is a patch.
Comment #9
tibor.antaloczy CreditAttribution: tibor.antaloczy commented+1 for underscores
Comment #10
iamjon CreditAttribution: iamjon commentedStatus needs review means that the module needs review. It would be nice if someone actually tested it.
Comment #11
lduerig CreditAttribution: lduerig commentedI applied the patch, great that I can enter underscores without errors, but it would be nice if they didn't get converted to dashes on the page. Anyone else get that?
Comment #12
lpalgarvio CreditAttribution: lpalgarvio commentedUnderscores are valid for CSS class names. read these resources:
- http://stackoverflow.com/questions/448981/what-characters-are-valid-in-c...
- http://www.w3.org/TR/CSS21/syndata.html#characters
- http://www.w3.org/TR/CSS21/grammar.html#tokenizer-diffs
+1 for underscores. please add support.
for now i have to do massive class name renaming... :(
Comment #13
dagmarThere are a "few" issues that needs review, please don't change the priority of an issue for a simple underscore addition in a css class. Be patient.
Comment #14
dawehnerYou could have changed the priority of the issue if you would have reviewed/tested the patch :)
Comment #15
Pisco CreditAttribution: Pisco commentedThanks dereine, unfortunately your patch doesn't seem to solve the problem. In
plugins/views_plugin_style.inc
(function get_row_class
) there's a call to drupal_clean_css_identifier which transliterates underscores to dashes. In my opinion drupal_clean_css_identifier should not replace underscores by default, I already filed an ticket for that: #1109854: Overly aggressive transliteration in drupal_clean_css_identifier removes underscores from classes. A workaround for the moment could beComment #16
Pisco CreditAttribution: Pisco commentedSeems like drupal_clean_css_identifier will not be fixed anytime soon: #1109854: Overly aggressive transliteration in drupal_clean_css_identifier removes underscores from classes, so I'd recommend the aforementioned workaround.
Comment #17
dawehner@Pisco
This issue is about the validation itself. There is another issue on the views issue queeu which removes drupal_clean_css_identifier/let it use the right identifiers.
So change back the patch. In general this issue is marked against 6.x-3.x so it should be first fixed there.
Comment #18
Pisco CreditAttribution: Pisco commented@dereine, you're right, sorry for the confusion with the versions. You were referring to #1032380: More than one wrapper class?
Comment #19
dawehnerYeah exactly.
Comment #20
shadysamir CreditAttribution: shadysamir commented+1
Comment #21
dawehnerThis change seemed to be already in 7.x-3.x so committed to 6.x-3.x only
Yeah another patch