473,805 Members | 2,141 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
25 2233

"Alan J. Flavell" <fl*****@ph.gla .ac.uk> wrote in message
news:Pi******** *************** ******@ppepc56. ph.gla.ac.uk...
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.


I haven't thought of them as useful for accessibility, but for general
usability. Not an important feature, but a convenience.

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.


True--and that may actually be a good reason to have these links. They alert
the reader to the fact, which may not otherwise have reached his attention,
that the place to which he has been taken is in the middle of a larger
page--which might contain even more useful information worth exploring.

Jul 21 '05 #11
"Lauri Raittila" <la***@raittila .cjb.net> wrote:
Easy solution: Back to top links are not good idea, so delete both and
markup related...

Harlan Messinger <h.*********@co mcast.net> wrote: That's the first time I've seen that opinion. Why aren't they a good idea?


Well, they do replicate a basic browser function (go the top of the current
page) that has been no more than a couple keystrokes (or mouse clicks or
stylus taps) away in any browser I've used. And in general, replicating
basic browser functions isn't a good idea.

But most actually reliably do what they claim to do, which is more than can
be said for most of the links that replicate browser functions (e.g., back,
close window, print).

So they're unnecessary at best. And in the rare case where the author
screws up, they're confusing when they don't actually take the user to the
top of the current document.
--
Darin McGrew, mc****@stanford alumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp. com, http://www.HTMLHelp.com/

"Entering Yosemite National Park: laws of gravity strictly enforced"
Jul 21 '05 #12
On Tue, 19 Oct 2004 13:08:33 -0400, Harlan Messinger
<h.*********@co mcast.net> wrote:
True--and that may actually be a good reason to have these links. They
alert
the reader to the fact, which may not otherwise have reached his
attention,
that the place to which he has been taken is in the middle of a larger
page--which might contain even more useful information worth exploring.


If the page is long and has numerous link points throughout, it probably
ought to have a table of contents. "Go to table of contents" is more
meaningful than "Go to top", because the user might assume that they WERE
at the top, so why bother clicking there?

Jul 21 '05 #13

"Neal" <ne*****@yahoo. com> wrote in message
news:op******** ******@news.ind ividual.net...
On Tue, 19 Oct 2004 13:08:33 -0400, Harlan Messinger
<h.*********@co mcast.net> wrote:
True--and that may actually be a good reason to have these links. They
alert
the reader to the fact, which may not otherwise have reached his
attention,
that the place to which he has been taken is in the middle of a larger
page--which might contain even more useful information worth exploring.


If the page is long and has numerous link points throughout, it probably
ought to have a table of contents. "Go to table of contents" is more
meaningful than "Go to top", because the user might assume that they WERE
at the top, so why bother clicking there?


If you're a user and you see a link that tells you "Go to top", you know
instantly that you're not already at the top, and it no longer matters if
you didn't know it a moment earlier.

Jul 21 '05 #14
On Tue, 19 Oct 2004 14:18:13 -0400, Harlan Messinger
<h.*********@co mcast.net> wrote:

"Neal" <ne*****@yahoo. com> wrote in message
news:op******** ******@news.ind ividual.net...
If the page is long and has numerous link points throughout, it probably
ought to have a table of contents. "Go to table of contents" is more
meaningful than "Go to top", because the user might assume that they
WERE
at the top, so why bother clicking there?


If you're a user and you see a link that tells you "Go to top", you know
instantly that you're not already at the top, and it no longer matters if
you didn't know it a moment earlier.


What I mean is this:

I click a link and I get this:

---------- top of viewport ----------
This is the information I linked to.

Paragraph paragraph paragraph, I need
to scroll down to get to the bottom.

This is the last paragraph.

_Go to top_

Now, I'm thinking this link will merely bring me to the starting point I
was at up the page a bit, which as far as I knew was the top. In fact, it
will bring me to a region of the page I don't even know existed.

If the link read _Go to table of contents_, well, I know I haven't seen
that. It's worth it to me to click here.

Jul 21 '05 #15

"Neal" <ne*****@yahoo. com> wrote in message
news:op******** ******@news.ind ividual.net...
On Tue, 19 Oct 2004 14:18:13 -0400, Harlan Messinger
<h.*********@co mcast.net> wrote:

"Neal" <ne*****@yahoo. com> wrote in message
news:op******** ******@news.ind ividual.net...
If the page is long and has numerous link points throughout, it probably ought to have a table of contents. "Go to table of contents" is more
meaningful than "Go to top", because the user might assume that they
WERE
at the top, so why bother clicking there?
If you're a user and you see a link that tells you "Go to top", you know
instantly that you're not already at the top, and it no longer matters if you didn't know it a moment earlier.


What I mean is this:

I click a link and I get this:

---------- top of viewport ----------
This is the information I linked to.

Paragraph paragraph paragraph, I need
to scroll down to get to the bottom.

This is the last paragraph.

_Go to top_

Now, I'm thinking this link will merely bring me to the starting point I
was at up the page a bit, which as far as I knew was the top. In fact, it
will bring me to a region of the page I don't even know existed.


I kind of know what you mean. But then, for regular user these links become
*associated* with pages where they might have arrived in the middle. So it
provides useful information. And for newbies who didn't realize that when
they come to a web page, they might not be at the top--well, you gotta learn
*some* time!

If the link read _Go to table of contents_, well, I know I haven't seen
that. It's worth it to me to click here.


That makes sense.

Jul 21 '05 #16
David wrote;
Lauri Raittila <la***@raittila .cjb.net> wrote:
(in message news:<MP******* *************** **@news.individ ual.net>)
[Code confusion about
A.backtotop:lin k { foo:bar;}
&
A.backtotop:lin k { bar:foo;}
]
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),


So X&fups to ciwah
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...


Here is what I can think:

1. There is functionality in browser
2. It never is only option
3. It makes keyboard navigation harder (assuming there is other links in
page)
4. It doesn't tell what is on the top - so why would someone follow that
link?
5. Sometimes link don't work, and user may avoid it because. For example,
if there is no anchor at the top of page. Surprisingly often top of
page links are done by just <a href="#">, and so don't work on some
browsers. (Opera 7.6p1, for example)
6. Only tells you that you are not at the top of document, if it is first
thing after anchor. Otherwise, one can think that it is link to back
the anchor, which user arrived to, if we suppose he didn't knew he
wasn't on top in first place.
7. Back to the top is confusing, if user never was on the top.

Can't think any use for them, that would really help.

I do use them sometimes, if availble. Even so often that I have noticed
#5. Also, when I tried to disable scrollbars, noticed #6. #7 is #7
because "back to top" links are so much used.

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Jul 21 '05 #17
"Harlan Messinger" <h.*********@co mcast.net> wrote in message news:<2t******* ******@uni-berlin.de>...

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


Yes, frequently.

Yeah, I agree. Use them all the time and find them quite useful.
Especially useful when using lynx/links, screen magnifiers. They're
more or less ubiquitous, have no detrimental effects on the browsing
experience worth mentioning, so you might as well provide them. Lots
of people use them. Rock on back to top links.
Jul 21 '05 #18
Neal <ne*****@yahoo. com> wrote in message news:<op******* *******@news.in dividual.net>.. .

What I mean is this:

I click a link and I get this:

---------- top of viewport ----------
This is the information I linked to.

Paragraph paragraph paragraph, I need
to scroll down to get to the bottom.

This is the last paragraph.

_Go to top_

Now, I'm thinking this link will merely bring me to the starting point I
was at up the page a bit, which as far as I knew was the top. In fact, it
will bring me to a region of the page I don't even know existed.

Yes. "top of page" would be more descriptive link text.
Jul 21 '05 #19
On 19 Oct 2004 16:43:25 -0700, David <da********@yah oo.co.uk> wrote:
Neal <ne*****@yahoo. com> wrote in message
news:<op******* *******@news.in dividual.net>.. .
_Go to top_

Now, I'm thinking this link will merely bring me to the starting point I
was at up the page a bit, which as far as I knew was the top. In fact,
it
will bring me to a region of the page I don't even know existed.

Yes. "top of page" would be more descriptive link text.


But that still doesn't avoid the problem that as far as I knew, I was
already at the top of the page. Why click it? I just read what was there.

Best to use content-related link text rather than position-related.
Jul 21 '05 #20

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

Similar topics

3
4072
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
2106
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
2517
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
2770
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
1657
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
2103
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
2013
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
9718
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
10613
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
10363
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...
0
9186
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
7649
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...
0
6876
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4327
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
2
3846
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.