Closed (fixed)
Project:
iTweak Upload
Version:
6.x-2.4
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Issue tags:
Reporter:
Created:
18 Jan 2011 at 22:45 UTC
Updated:
3 Jan 2014 at 02:58 UTC
Jump to comment: Most recent
Comments
Comment #1
iva2k commented!important was added to "break through" the theme CSS's that are loaded after ITU CSS. Need some other (clever) way to achieve that. Just counted invocations - !important is used about 60 times. That would be a lot of work to remove all of them and re-test with major themes. Maybe you can identify specific cases (line numbers) that you need removed?
Comment #2
iva2k commentedAlso, did you try using "!important" in your custom CSS in the theme? That will work to override the override.
Comment #3
justins2n commentedOh, ok. That makes sense. First of all, I appreciate the response! I tried using "!important" in my custom CSS and for some reason it wasn't overriding iTweak's CSS. The main cases would be the "table.itu-attachment-list tbody", really anything with "tbody". Again, thanks for your help on this.
Comment #4
iva2k commentedComment #5
iva2k commentedI went through the tbody styles, and there are 3 uses of !important of concern. I removed those and tested with couple of major-use themes, and this is a no-go. Themes have some blanket styling that applies to all elements. iTweak Upload, being a module, has its css loaded before the theme's css, so theme overrides these styles. So I can't remove !important from the module. The workaround is to use !important in theme's local.css (or similar user-customized file). I added comment to itweak_upload.css (in 6.x.-2.x-dev), and consider that as the fix.
Comment #6
markhalliwellActually this is a very critical issue. You should rarely use
!importantin CSS unless it's absolutely necessary. It is the theme's job to provide styling, not ONLY the module. The module should provide defaults of course, but the theme should be able to override them by simply redefining any CSS the module uses (and not needing to also define!importantto override your!important). This is an extreme overuse of!important! You don't need it. You have already defined custom classes and IDs, which take precedence over the the core CSS (http://www.vanseodesign.com/css/css-specificity-inheritance-cascaade/).I can understand the need for positioning importance. Which would be acceptable as you are essentially modifying the structure which usually doesn't impact a theme on a grand scale. However, when you start messing with colors/backgrounds that's a no no. It's the themes job to provide coloring.
For example:
You override the backgrounds of the table rows. Many themes prefer to keep the striping as it helps differentiate between each row. That being said, you can simply easily add an option to remove zebra striping for your module. A simple check box that the site can configure. And then all you'd have to do is simply pass an extra class of
nozebrato each row if it's disabled. Many themes provide (even Garland, which most themes are initially based from) this class and theme the class appropriately. Garland's is:All this being said, I also have some improvements that I have added to my theme that you might consider:
Comment #7
iva2k commentedThe goal of the module is to work out of the box. Advising users to edit their theme during installation is too steep and against that goal. Once they into themeing, they can use !important in their customizations - they are totally allowed to do that as they wish or need.
On the general discussion: As I said, I put !important only when I had to struggle with blanket styling of a couple of major themes (to be specific - Garland, Acquia Marina). Custom classes did not help because I had to maintain certain standard classes, and CSS works based on load order which I don't have control between module and theme.
As for the zebra, solution proposed in #6 (to pass nozebra into the table classes) is a no-go since it will remove ability to re-paint zebra on that table in custom css.
To reiterate, I will review a patch and if it passes the following criteria, I will commit it:
Comment #8
iva2k commentedComment #9
iva2k commentedNo activity for over 4 weeks - closing. Please reopen with additional information as suggested in #7 if you have a patch.
Comment #10
holydrupal commentedI have checked itweak css with CSS3 validator and found this issues: