473,796 Members | 2,679 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Comparing stylesheets

I've got a 50k main.css file that's referenced by a load of sites.
Each of these sites also has a site.css file that modifies certain
styles defined in main.css. Changing the colour of borders, boxes etc,
as well as defining certain site specific styles. site.css is small
and easy to understand, and the only bit that can be edited by the
masses.

That's the theory. The practice is that there are now 4 sites going
live
in a week where some muppet who claims to understand css has just
copied
main.css in chunks, renamed it site.css, tweaked some bits and added
more, without deleting the inherited styles (*nice full explanation
below). It all works fine, but it means each site's site.css is now
about 60k, when it's meant to be nice and neat and about 10/20k.

So, to the question:
What tools do people out there use that could help me? Is there any
tool that can compare declarations across multiple stylesheets to
prevent me from sitting down and laboriously going through every style
declaration in site.css to check if it's redundant or not? 4 times
over? I've had a look at Topstyle and it doesn't seem to perform this
function, which I find surprising. Am I being stupid?

diff/sed/awk etc aren't options, btw...(I ain't a unix god)


*Crystal clear explanation:
in main.css there is this statement:

A.backtotop:lin k, A.backtotop:vis ited {
float:right;
margin-top:5px;
margin-right:10px;
margin-left:7px;
padding-left:10px;
font-size:70%;
color:#fff;
background:url( arrow_white_up. gif) 0 0.6em no-repeat;
}
A.backtotop:hov er {color:#fff;}
In site.css there is this statement:

A.backtotop:lin k, A.backtotop:vis ited {
float:right;
margin-top:5px;
margin-right:0;
margin-left:7px;
padding-left:10px;
font-size:70%;
text-decoration:none ;
color:#000;
background:url( arrow_black_up. gif) 0 0.6em no-repeat;
}
A.backtotop:hov er {text-decoration:unde rline; }
site.css doesn't need those duplicate declarations, so that the
declaration in site.css *should* read:

A.backtotop:lin k, A.backtotop:vis ited {
margin-right:0;
text-decoration:none ;
color:#000;
background:url( arrow_black_up. gif) 0 0.6em no-repeat;
}
A.backtotop:hov er {text-decoration:unde rline; }
But, like, there's 240k of this stuff...
Jul 21 '05 #1
25 2231
"David" <da********@yah oo.co.uk> wrote in message
news:99******** *************** ***@posting.goo gle.com...
I've got a 50k main.css file that's referenced by a load of sites.
Each of these sites also has a site.css file that modifies certain
styles defined in main.css. Changing the colour of borders, boxes etc,
as well as defining certain site specific styles. site.css is small
and easy to understand, and the only bit that can be edited by the
masses.

That's the theory. The practice is that there are now 4 sites going
live
in a week where some muppet who claims to understand css has just
copied
main.css in chunks, renamed it site.css, tweaked some bits and added
more, without deleting the inherited styles (*nice full explanation
below). It all works fine, but it means each site's site.css is now
about 60k, when it's meant to be nice and neat and about 10/20k.

So, to the question:
What tools do people out there use that could help me? Is there any
tool that can compare declarations across multiple stylesheets to
prevent me from sitting down and laboriously going through every style
declaration in site.css to check if it's redundant or not? 4 times
over? I've had a look at Topstyle and it doesn't seem to perform this
function, which I find surprising. Am I being stupid?


If you made a backup before the muppet showed up, restore the files from the
backup. Otherwise ...

.... if you have Windows, you can try to recover the old files from the
Recycle Bin.

Jul 21 '05 #2
David wrote;
I've got a 50k main.css file that's referenced by a load of sites.
Too heavy.
below). It all works fine, but it means each site's site.css is now
about 60k, when it's meant to be nice and neat and about 10/20k.
Worse
So, to the question:
What tools do people out there use that could help me? Is there any
tool that can compare declarations across multiple stylesheets to
prevent me from sitting down and laboriously going through every style
declaration in site.css to check if it's redundant or not? 4 times
over? I've had a look at Topstyle and it doesn't seem to perform this
function, which I find surprising. Am I being stupid?

diff/sed/awk etc aren't options, btw...(I ain't a unix god)
Too bad... Perl?... If you can't find any tool, it might made sence to
pay someone to do such tool, so next time such exsist. If I ahd this
problem, I would certainly make a tool... Someone with knowledge of some
CSS parser would make better tool.
in main.css there is this statement:

A.backtotop:lin k, A.backtotop:vis ited {
float:right;
margin-top:5px;
margin-right:10px;
margin-left:7px;
padding-left:10px;
font-size:70%;
color:#fff;
background:url( arrow_white_up. gif) 0 0.6em no-repeat;
}
A.backtotop:hov er {color:#fff;}
Easy solution: Back to top links are not good idea, so delete both and
markup related...
But, like, there's 240k of this stuff...


Hm, If I got you right, you have 4 site.css, and you need to get common
stuff out of them to main.css? Or do you have some specific reason to
just remove stuff in main.css from site.csses?

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Jul 21 '05 #3

"Lauri Raittila" <la***@raittila .cjb.net> wrote in message
news:MP******** *************** *@news.individu al.net...
Easy solution: Back to top links are not good idea, so delete both and
markup related...


That's the first time I've seen that opinion. Why aren't they a good idea?

Jul 21 '05 #4
Lauri Raittila <la***@raittila .cjb.net> wrote in message news:<MP******* *************** **@news.individ ual.net>...
I've got a 50k main.css file that's referenced by a load of sites.
Too heavy.

Yeah. You're right. It's big. Lots of commonality across sites...we're
actually going to split it up a bit so we've got a

main.css
sitegroup.css
site.css

....sort of layout. Should reduce main to about 30k or so.

Too bad... Perl?... If you can't find any tool, it might made sence to
pay someone to do such tool, so next time such exsist. If I ahd this
problem, I would certainly make a tool... Someone with knowledge of some
CSS parser would make better tool.

I am getting the horrible sinking feeling that it's going to be a perl
jobby. Not *too* difficult (for someone other than me), but I was
really hoping TopStyle had this functionality - I'm quite surprised it
doesn't, given the nature of CSS it would seem natural that at some
point you'd be importing multiple stylesheets into a document and have
the possibility of duplicate styles occurring. Be a dead useful
feature. For me. Right now. Ho hum.

Easy solution: Back to top links are not good idea, so delete both and
markup related...

Interesting. Perhaps not the forum for it (I imagine we'd get justly
flamed for discussing non-css stuff), but if you want to take this off
list I'd be interested to know your reasons for saying back to top
links aren't a good idea...it's something I've never heard before...

Hm, If I got you right, you have 4 site.css, and you need to get common
stuff out of them to main.css? Or do you have some specific reason to
just remove stuff in main.css from site.csses?

Nope. I need to remove declarations in the site.css files that are
identical to declarations in main.css...
Jul 21 '05 #5
"C A Upsdell" <cupsdell0311XX X@-@-@XXXrogers.com> wrote in message news:<hu******* *************@r ogers.com>...

If you made a backup before the muppet showed up, restore the files from the
backup. Otherwise ...

... if you have Windows, you can try to recover the old files from the
Recycle Bin.

Oh, if only it were that simple :)

The muppet has (to be honest) done a pretty extensive amount of OK
work on the site.css files, it's just the inclusion of redundant stuff
that's the problem.
Jul 21 '05 #6
David wrote:
Lauri Raittila <la***@raittila .cjb.net> wrote in message news:<MP******* *************** **@news.individ ual.net>...

Easy solution: Back to top links are not good idea, so delete both and
markup related...


Interesting. Perhaps not the forum for it (I imagine we'd get justly
flamed for discussing non-css stuff), but if you want to take this off
list I'd be interested to know your reasons for saying back to top
links aren't a good idea...it's something I've never heard before...


It's a feature. We don't like features round here. ;-)

--
Mark.
http://tranchant.plus.com/
Jul 21 '05 #7
"Harlan Messinger" <h.*********@co mcast.net> a écrit :

| "Lauri Raittila" <la***@raittila .cjb.net> wrote in message:
|
| > Easy solution: Back to top links are not good idea, so delete both and
| > markup related...
|
| That's the first time I've seen that opinion. Why aren't they a good
| idea?

As a user, have you ever used one of them? Have you ever _needed_ one of
them?

--
Daniel Déchelotte
http://yo.dan.free.fr/
Jul 21 '05 #8
On Tue, 19 Oct 2004, Daniel [ISO-8859-15] Déchelotte wrote:
| "Lauri Raittila" <la***@raittila .cjb.net> wrote in message:
|
| > Easy solution: Back to top links are not good idea, so delete both and
| > markup related...
[...]
As a user, have you ever used one of them? Have you ever _needed_
one of them?


No; but there's some kind of theory (I'd tend rather to think of it as
"superstiti on", I'm afraid) that they are useful for accessibility.

However, I don't know a browser that doesn't have several different
ways of its own to get to the head of the page[1], so I reckon they're
just a confusing waste of good markup. Those disabled folks that I've
met have shown much better abilities at using the browser's own
built-in tools on every page (rather than letting themselves be misled
by page-specific or site-specific ersatz features) - as compared to
some ordinary folks whose only "disability " was shortage of a clue.

cheers

[1] Notice that I didn't say "back to the head of the page", because a
reader who went to a fragment URL (wibble#whateve r) might never have
seen the head of the page before - hence, it can be illogical to speak
about going "back" to it.
Jul 21 '05 #9

"Daniel Déchelotte" <ma**********@f r.club-internet.invali d> wrote in message
news:2004101917 2426.6d459e1e.m a**********@fr. club-internet.invali d...
"Harlan Messinger" <h.*********@co mcast.net> a écrit :

| "Lauri Raittila" <la***@raittila .cjb.net> wrote in message:
|
| > Easy solution: Back to top links are not good idea, so delete both and
| > markup related...
|
| That's the first time I've seen that opinion. Why aren't they a good
| idea?

As a user, have you ever used one of them?
Yes, frequently.

Have you ever _needed_ one of them?


I don't need a mouse either--at least for web sites that build pages fully
accessible by keyboard--but I use one.

Jul 21 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
4071
by: jason baumunk | last post by:
I author applications in php which use external stylesheets. When viewed through ie 6, netscape 6, et al. occassionally the stylesheets will not load or be applied. Has anybody encountered this and found a fix/workaround so that the stylesheets are verified as having been loaded/applied? I'm running apache and the external stylesheets are actually php files that serve dynamic stylesheets(ie, site.css.php......I don't suspect that this...
13
2105
by: Toby A Inkster | last post by:
www.authoring.stylesheets] For ages I have provided links to alternate stylesheets from my pages as per W3C recommendations: <link rel="stylesheet" href="baz" type="text/css" title="Baz" media="screen,projection" /> <link rel="alternate stylesheet" href="foo" type="text/css" title="Foo" media="screen,projection" /> <link rel="alternate stylesheet" href="bar" type="text/css" title="Bar"
6
2515
by: Jan Roland Eriksson | last post by:
Archive-name: www/stylesheets/newsgroup-faq Posting-Frequency: twice a week (mondays and thursdays) Last-modified: March 10, 2001 Version: 1.95 URL: http://css.nu/faq/ciwas-mFAQ.html Maintainer: Jan Roland Eriksson <rex@css.nu> comp.infosystems.www.authoring.stylesheets FAQ v1.95 ______________________________________________________________________
2
2765
by: Jan Roland Eriksson | last post by:
Archive-name: www/stylesheets/newsgroup-faq Posting-Frequency: once a week Last-modified: 2004-07-26 Version: 2.00 URL: <http://css.nu/faq/ciwas-mFAQ.html> Maintainer: Jan Roland Eriksson <rex@css.nu> comp.infosystems.www.authoring.stylesheets meta-FAQ v2.00 _______________________________________________________________________
0
1654
by: Jan Roland Eriksson | last post by:
Archive-name: www/stylesheets/newsgroup-faq Posting-Frequency: once a week Last-modified: 2004-07-26 Version: 2.00 URL: <http://css.nu/faq/ciwas-mFAQ.html> Maintainer: Jan Roland Eriksson <rex@css.nu> comp.infosystems.www.authoring.stylesheets meta-FAQ v2.00 _______________________________________________________________________
0
2099
by: Jan Roland Eriksson | last post by:
Archive-name: www/stylesheets/newsgroup-faq Posting-Frequency: once a week Last-modified: 2004-07-26 Version: 2.00 URL: <http://css.nu/faq/ciwas-mFAQ.html> Maintainer: Jan Roland Eriksson <rex@css.nu> comp.infosystems.www.authoring.stylesheets meta-FAQ v2.00 _______________________________________________________________________
2
2012
by: Mr X | last post by:
I'm a few weeks new to JS, and am having a problem. I have a simple INTERNAL style in a web page and I know that style is working. The problem arises when I try to run a script that changes one of that style's properties. The style is... -------------------------------------------------- ..xtable, .xtable TD, .xtable TH { background-color:black; color:white; font-family:arial; }
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9535
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10465
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10242
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10200
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10021
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9061
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7558
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4127
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.