By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,885 Members | 1,499 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,885 IT Pros & Developers. It's quick & easy.

Reset form control style

P: n/a
Hi,

I've run across a problem styling form controls (quel surprise), or rather
in this case, "unstyling" them. I'm trying to put together a theme for a
web application which has a fairly primitive theme engine. Specifically, I
can define *additional* CSS rules using the theme engine, but I can't
remove the pre-existing ones that come with the application.

For the vast majority of the theme this hasn't been a problem given that
overriding stuff with CSS is hardly difficult. However, the base CSS rules
apply styles to most form controls (buttons, text areas, etc). I'd like to
override this to get the browser to render the form controls in the
"default" style, i.e. the way it would render them without any CSS rules
applied (usually the OS style in things like Opera, IE, Safari, etc).

Unfortunately, I haven't found any way of doing this - either in a
portable "clean" manner, or even in a browser-specific manner. I suspect
the answer is "you can't", but it doesn't hurt to check with the experts
:-)
Cheers,

Dave.
Dec 21 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
rf

"Dave Hughes" <da**@waveform.plus.comwrote in message
news:op***************@stewie.waveform.plus.com...
Hi,

I've run across a problem styling form controls (quel surprise), or rather
in this case, "unstyling" them. I'm trying to put together a theme for a
web application which has a fairly primitive theme engine. Specifically, I
can define *additional* CSS rules using the theme engine, but I can't
remove the pre-existing ones that come with the application.
Yes you can. Just use an additional rule specifying the default or initial
value. For example if the drezigner who designed the "application" specified
line-height as some number of pixels then specify line-height: normal;, the
initial value for this property.

--
Richard.
Dec 21 '07 #2

P: n/a
Scripsit Dave Hughes:
I'm trying to put together a
theme for a web application which has a fairly primitive theme
engine.
Just don't do that. Problem solved. Check some articles on usability.
The basic presentation of forms should be uniform _across the web_ to
serve the purpose of smooth _interaction_, rather than the dee-ziner's
artistic self-expression.
Specifically, I can define *additional* CSS rules using the
theme engine, but I can't remove the pre-existing ones that come with
the application.
What "application"? The browser? What _other_ "applications" underlie on
the web?
I'd like to override this to get the browser to render the form
controls in the "default" style, i.e. the way it would render them
without any CSS rules applied (usually the OS style in things like
Opera, IE, Safari, etc).
Just don't use "themes" for forms, mm'kay?
Unfortunately, I haven't found any way of doing this - either in a
portable "clean" manner, or even in a browser-specific manner.
There isn't, except perhaps in a highly browser-specific manner, and
usually not even that.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Dec 21 '07 #3

P: n/a
On Fri, 21 Dec 2007 14:31:12 -0000, Jukka K. Korpela <jk******@cs.tut.fi>
wrote:
Scripsit Dave Hughes:
>I'm trying to put together a
theme for a web application which has a fairly primitive theme
engine.

Just don't do that. Problem solved. Check some articles on usability.
The basic presentation of forms should be uniform _across the web_ to
serve the purpose of smooth _interaction_, rather than the dee-ziner's
artistic self-expression.
I agree entirely. In fact, that's the problem...
>Specifically, I can define *additional* CSS rules using the
theme engine, but I can't remove the pre-existing ones that come with
the application.

What "application"? The browser? What _other_ "applications" underlie on
the web?
Perhaps "web application" is wrong phrase in this context, although I'm
not currently aware of a widely accepted alternative (at least in my
domain as a software developer). Anyway, the "web application" in question
is Trac (http://trac.edgewall.org/), specifically version 0.10.
>I'd like to override this to get the browser to render the form
controls in the "default" style, i.e. the way it would render them
without any CSS rules applied (usually the OS style in things like
Opera, IE, Safari, etc).

Just don't use "themes" for forms, mm'kay?
Indeed - Trac by default styles its forms (e.g. see
http://trac.edgewall.org/newticket), and I want *remove* the styling. I
don't actually think the default style is "bad" exactly (it's far from the
worst I've seen), but in the interest of usability I'd like to use the
browser's default style of controls as it's what the user is most likely
to be familiar with (especially in the case of browsers that use the OS to
render unstyled form controls).

Unfortunately, Trac 0.10's theme engine only allows one to define
*additional* stylesheets - one cannot remove the existing stylesheets
shipped with the application. Obviously, one could remove or edit the
stylesheets on a given installation but that's outside the purview of the
theme engine (and would break the ability to easily revert to the default
style should the administrator wish to do so).
>Unfortunately, I haven't found any way of doing this - either in a
portable "clean" manner, or even in a browser-specific manner.

There isn't, except perhaps in a highly browser-specific manner, and
usually not even that.
I'm aware this is the case for styling form controls, but I was hoping
(probably stupidly :-) that it might not be the case for "unstyling" them.
Given that I couldn't seem to find anything on overriding form control
styles to reset them to the browser's default (beyond "delete the rules"),
I was hoping I'd missed something obvious.
Thanks,

Dave.
Dec 21 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.