It would be good if possible to get a more accurate feel for what percentage of articles use inline styles. e.g. articles that contain style= vs articles that don't This would help us get a better idea of what we are dealing with.
The example given of highlighting - I understand the need for something like this - but this sounds like it would be better off as a global style in MediaWiki:Common.css so highlighting is consistent across all wiki articles. If one template is highlighting text in yellow and another in orange and they are trying to emphasise the same thing this is not so good in my opinion!
My main issue with inline styles is the mixing of css and html. I still think it would be much more manageable if templates were able to manage their own stylesheets instead and use classes for styling purposes but as I understand this could be a tricky manoeuvre.
I don't think a nomobile class would help here - if something is broken now on the mobile site why would someone add a nomobile class rather than fixing the inline style? Also rendering the content badly is probably better than not rendering it at all.
I think our main goal should be an agreed way to cleanup these inline styles effectively. The current procedure for cleaning these up is not working in my opinion as bug 36076 [1] was raised in the middle of April and a duplicate bug 36750 [2] was raised almost half a month later despite some discussion around the subject.
The example of the track listings is caused by an inline style margin:-1px 21em 0 0; - there is no reason this should not be used on the desktop site - but obviously this is not fit for purpose on the mobile site. If this was styled via a stylesheet (either MediaWiki:Common.css or other) these rules can be optimised for mobile (the mobile site body tag carries a class 'mobile' and there are of course media queries)
I still think the turning off inline styles on the beta has merit as it provides us an effective method of working out which styles are essential to both mobile and desktop and should be in stylesheets rather than existing as inline styles. If we are not keen on the @mobilesafe annotation there is no reason we have to go down that route.
So another course of action might be: 1) scrub inline styles in the beta of the mobile site 2) assess damage and shift all important and generic inline styles to stylesheets - this will take time but is a very worthwhile community exercise (in my opinion this would be anything involving floats, margins, padding and fixed widths) 3) add mobile specific styles for these to stylesheets 4) Turn off inline style scrubbing in beta 5) Introduce guidelines for when things should be inline styles and when not to try to prevent us getting to this point again in the future 6 (long term) Deprecate the need for inline styles by allowing css declarations within wikitext.
[1] https://bugzilla.wikimedia.org/show_bug.cgi?id=36076 [2] https://bugzilla.wikimedia.org/show_bug.cgi?id=36740
On Fri, May 11, 2012 at 2:17 PM, Max Semenik maxsem.wiki@gmail.com wrote:
On 11.05.2012, 12:24 Ryan wrote:
What about this idea: We could introduce a new CSS class called 'nomobile' that functioned similarly to 'noprint' — any element set to this class would be hidden completely on mobile devices. If someone noticed a problem with a specific template on mobile devices, they could either fix the template or set it to 'nomobile'. This would make template creators aware of the problem and give them an incentive to fix their inline styles.
Such functionality already exists, even with the same class name ;-8 However, there's a problem with this code[1] that prevents it from working in all situations.
[1] https://bugzilla.wikimedia.org/show_bug.cgi?id=36742
-- Best regards, Max Semenik ([[User:MaxSem]])
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l