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.
Currently the theme applies drop shadows to images. In some situations I would prefer the images not have a drop shadow applied. Is there a way to not apply drop shadows to specific images?
Comment | File | Size | Author |
---|
Comments
Comment #1
westis CreditAttribution: westis commentedYup, I'm actually trying to accomplish this myself. Have written a thread here: https://drupal.org/node/2040535
The issue is to add a class to images that should not have borders/drop shadows. I haven't yet tested the patch in the above thread, but will do that when I get time. Then we just need to add a style for the class "noborder" to the theme.
Will look at this next week.
Comment #2
westis CreditAttribution: westis commentedI've added a request to add the patch for the Picture module, to include a class for an image (and then style that class in CSS Injector for example, to remove the border around the image): https://drupal.org/node/2107409
Comment #3
Finnaholm CreditAttribution: Finnaholm commentedThere is an issue with the Media module (not Picture) - it's not cooperating well with the WYSIWYG-editors. Properties are not saved since the images are not regular tags. See:
https://drupal.org/node/1801308
https://drupal.org/node/2067063
Until the Media module is properly patched, to remove the border one need to change the editor to plain text or use the "edit html" feature and then manually add the "noborder" class - either directly to the image properties or to a paragraph tag surrounding the image.
The only thing changed in the cm_theme is the addition of noborder class to the css:
.noborder img { box-shadow: none; }
Comment #4
kreynen CreditAttribution: kreynen commentedAccording to comments on #2067063: Wysiwyg integration is broken the dev release of Media back in Nov 2013 fixed the main issues.
@jwilson3 confirmed that it was working if the patch for #2126697: Wysiwyg -- Alt and Title fields require some special handling. was added.
Have you tested the dev version? The dev version with that patch?
Comment #5
kreynen CreditAttribution: kreynen commentedComment #6
Finnaholm CreditAttribution: Finnaholm commentedI have tried the dev version now and I can confirm it does work (without the additonal patch).
Now to test the dev version some more to make sure it doesn't introduce new problems.
Comment #7
libkuman CreditAttribution: libkuman commentedComment #8
kreynen CreditAttribution: kreynen commentedComment #9
bagelche CreditAttribution: bagelche commentedTo get rid of the drop shadows, I used this line in CSS Injector:
#main img { box-shadow: 0 0 0; }
which gets rid of drop shadows across the board in the theme. It doesn't address the desire/need for a mechanism to have drop shadows on some issues through classes or another method.
Comment #10
kreynen CreditAttribution: kreynen commentedComment #11
kreynen CreditAttribution: kreynen commentedI've added a textarea to the settings form at admin/appearance/settings/cm_theme_zen to add or remove the CSS classes and/or ids you want the dropshadow treatment on. I've removed the dropshadows applied to img from the css and sass file and then dynamically add them in the html.tpl.php.
While this gets the job done, it would be nice to have some checkboxes of human readable options for people to click that could add dropshadows to "Images in Full Page", "Images in Teaser", etc.
adding cmd-starter since anyone with some basic PHP skills could build on this
Comment #12
kreynen CreditAttribution: kreynen commentedI had a working version of this, but it never got committed. Recreating now.
Comment #13
kreynen CreditAttribution: kreynen commentedThis IS in the current dev snapshot. Configuration can be found at admin/appearance/settings/cm_theme_zen