I’m just jotting down a couple things that I figured out recently with regards to making modifications to the CKEditor WYSWIG editor in a Drupal 7 installation.
On a recent project, we had a client who wanted the ability to have images in the body float left or right. What I wanted to see happen, as a front end developer, is that the images would simply have a class attached to them, and my external CSS would handle the floating.
Why a class (as opposed to inline styling?):
Cleaner markup in general
Style attributes were being stripped by our text format, and I didn’t want to let any HTML fly within this format
Just adding a class would make future modifications easier (rather than trying to modify individual instances of inline styles)
After an afternoon of experimentation, I found out you need two files added to your theme, and a weird trick to make sure it works.
I recently learned of a feature of SASS that I think is extremely powerful, and little known about. I’m not even sure if it has a proper name*, so I’ll make one up and call it the “insert parent selector”. And it can help you deal with exceptions or variations that might make otherwise modular code become unruly.
And all it comes down to is a trailing ampersand – “&”.