Skip to main content

Search and Top Navigation

#7647 closed bug (notabug)

Opened August 17, 2011 07:26PM UTC

Closed November 07, 2011 04:33PM UTC

CSS class repeated needlessly

Reported by: johnp Owned by:
Priority: minor Milestone: 1.9.0
Component: ui.css-framework Version: 1.8.15
Keywords: Cc:
Blocked by: Blocking:
Description

I downloaded a build of 1.8.15 with the UI lightness theme. The resulting jquery-ui-1.8.15.custom.css contains many instances where a class appears multiple times in a given rule. One example appears under "Interaction Cues". .ui-state-error is listed 3 times for this single rule.

.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #b81900 url(images/ui-bg_diagonals-thick_18_b81900_40x40.png) 50% 50% repeat; color: #ffffff; }

I know that it's valid CSS, but it adds unnecessary weight to the CSS file.

Attachments (0)
Change History (4)

Changed August 17, 2011 08:50PM UTC by scottgonzalez comment:1

component: [meta] ui.buildCSS Framework

Changed November 06, 2011 07:28PM UTC by M.Gaetan89 comment:2

The change has been submitted on GitHub : https://github.com/jquery/jquery-ui/pull/518

Changed November 07, 2011 12:57PM UTC by rdworth comment:3

_comment0: The proposed change will cut the specificity in half, down from two class names to one class name. This means a simple rule like \ {{{ \ .main div { border: none; } \ }}} \ later in a stylesheet will override this style where before this change it would not. If the classes were listed needlessly I could understand removing them, but they're listed in this manner by design and removing them will have a negative effect.1320670690919627

The proposed change will cut the specificity in half, down from two class names to one class name. This means a simple rule like

.main div { border: none; }

later in a stylesheet will override this style where before this change it would not. If the classes were listed needlessly I could understand removing them, but they're listed in this manner by design and removing them will have a negative effect.

Recommend closing "as designed"/invalid

Changed November 07, 2011 04:33PM UTC by rdworth comment:4

resolution: → invalid
status: newclosed