SmartSprites

Minimize the output css by concatenating all the styles under same sprite

Details

  • Type: New Feature New Feature
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: 0.4.0
  • Component/s: None
  • Labels:
    None

Description

At the moment each class specifies again and again the sprite file.
i.e.
.openidIcon_livejournal {
background-image: url('img/Secure_OpenIDLogin.png');
-background-image: url('img/Secure_OpenIDLogin-ie6.png');
background-position: left -424px;
}
.openidIcon_wordpress {
background-image: url('img/Secure_OpenIDLogin.png');
-background-image: url('img/Secure_OpenIDLogin-ie6.png');
background-position: left -440px;
}
.openidIcon_blogger {
background-image: url('img/Secure_OpenIDLogin.png');
-background-image: url('img/Secure_OpenIDLogin-ie6.png');
background-position: left -456px;
}

Add an option to define it just once.
i.e
.openidIcon_livejournal, .openidIcon_wordpress, .openidIcon_blogger {
background-image: url('img/Secure_OpenIDLogin.png');
-background-image: url('img/Secure_OpenIDLogin-ie6.png');
}
.openidIcon_livejournal {
background-position: left -424px;
}
.openidIcon_wordpress {
background-position: left -440px;
}
.openidIcon_blogger {
background-position: left -456px;
}

Or even better:
.openidIcon {
background-image: url('img/Secure_OpenIDLogin.png');
-background-image: url('img/Secure_OpenIDLogin-ie6.png');
}
#livejournal.openidIcon {
background-position: left -424px;
}
#wordpress.openidIcon {
background-position: left -440px;
}
#blogger.openidIcon {
background-position: left -456px;
}

Issue Links

Activity

Hide
Stanisław Osiński added a comment -

Hi there,

Thanks for the suggestion! The first suggested compression should be doable once SMARTSPRITES-47 is done. The second compression sounds very much like a heuristic and it's not always applicable (think of a selector like this: {{li#menu > small.item { ... }}}).

Cheers,

Staszek

Show
Stanisław Osiński added a comment - Hi there, Thanks for the suggestion! The first suggested compression should be doable once SMARTSPRITES-47 is done. The second compression sounds very much like a heuristic and it's not always applicable (think of a selector like this: {{li#menu > small.item { ... }}}). Cheers, Staszek

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:

Time Tracking

Estimated:
16h
Original Estimate - 16h
Remaining:
16h
Remaining Estimate - 16h
Logged:
Not Specified
Time Spent - Not Specified