Last Comment Bug 717826 - implement @important rule to reduce need for redundant !important
: implement @important rule to reduce need for redundant !important
Status: NEW
Product: Core
Classification: Components
Component: CSS Parsing and Computation (show other bugs)
: unspecified
: All All
-- enhancement with 2 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
: Jet Villegas (:jet)
Depends on:
  Show dependency treegraph
Reported: 2012-01-12 18:04 PST by Felix Miata
Modified: 2013-05-21 08:06 PDT (History)
2 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Description User image Felix Miata 2012-01-12 18:04:52 PST
[As suggested by www-style mailing list thread beginning at: started by Marat Tanalin]

As it is now, user stylesheet rules that omit !important are all but worthless. This proposal should not be limited to user stylesheets though.

It would be much more usable to have at-rule of the same name to prevent redundant multiple "!important" word duplication.

For example, currently we write:

	#statusbar-display {
		left:  0 !important;
		right: auto !important;

	#statusbar-display .statuspanel-label {
		border-left-style:  none !important;
		border-right-style: solid !important;

Instead we could wrap the rules to one @important rule, thus avoiding repeating "!important" multiple times:

	@important {
		#statusbar-display {
			left:  0;
			right: auto;

		#statusbar-display .statuspanel-label {
			border-left-style:  none;
			border-right-style: solid;
Comment 1 User image Marat Tanalin | 2012-01-13 00:18:04 PST
Thanks, Felix.

In addition: since the feature is nonstandard yet, it probably should be -moz-prefixed:

	@-moz-important {

Note You need to log in before you can comment on or make changes to this bug.