[wp-hackers] Inline styles and TinyMCE

Jess Planck jess at funroe.net
Thu Sep 10 15:15:34 UTC 2009


I made a comment to that ticket, but I thought I would make it here as  
well.

It's a great idea, but before it gets set in stone I would really like  
to see some better CSS naming conventions for the HTML objects  
WordPress creates. There is no coding standard for CSS like there is  
for PHP in WordPress, so here's the type of things we get:

For an attachment starting div id is attachment_13 with classes wp- 
caption and alignleft wrapped around an img with classes size-medium  
wp-image-13 and a p with class wp-caption-text. It's not bad but there  
are dashes, underscores, compounded words, and very little to help you  
predict the sort of CSS that WordPress is going to spit out. Of course  
object oriented CSS approaches were the techniques aren't being used.  
It's getting better, but don't go look at the some of the buddypress  
CSS names (it burns!).

If WordPress adds some removable default css for these objects then  
some better naming conventions for the CSS classes and ids would  
really help. Especially some prefix that says "This came from  
WordPress" like a wp-gallery, wp-attachment, or something else parse- 
able used in CSS ids and classes.

Jess

[  :P  ]  jess planck  -  http://funroe.net

On Sep 9, 2009, at 6:31 PM, scribu wrote:

> A new ticket on trac contends that TinyMCE should use predefined  
> classes
> instead of inline styles: #10753<http://core.trac.wordpress.org/ticket/10753 
> >
>
> The main drawback is that it would require themes to add these  
> predefined
> styles to their stylesheet, beside the  
> classical .alignleft, .aligncenter
> and .alignright
>
> This is my proposed solution:
>
> Instead of relying on each theme developer, make a default.css file  
> and add
> it through 'wp_head'.
>
> - fixes the inline styles in TinyMCE
> - potentially fixes inline styles generated by [gallery]
> - themers can disable it if they wish
>
> What do you think?
>
>
> -- 
> http://scribu.net
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list