The default bug view has changed. See this FAQ.

implement @important rule to reduce need for redundant !important

NEW
Unassigned

Status

()

Core
CSS Parsing and Computation
--
enhancement
5 years ago
4 years ago

People

(Reporter: Felix Miata, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

5 years ago
[As suggested by www-style mailing list thread beginning at: http://lists.w3.org/Archives/Public/www-style/2012Jan/0182.html 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;
		}
	}
Thanks, Felix.

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

	@-moz-important {
		...
	}
You need to log in before you can comment on or make changes to this bug.