Forum Moderators: not2easy

Message Too Old, No Replies

is there any CSS converter?

         

Xuefer

12:32 pm on Mar 20, 2003 (gmt 0)

10+ Year Member



compact css <--> strict csss
and --> hacked css

DrDoc

6:36 pm on Mar 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Of course I don't know, but I'd be willing to promise you that the answer is a solid NO.

Even if there would be one, I wouldn't trust it 100%. You would have to worry about whether it covers all the browsers, if it is truly up to date, and that it doesn't mess things up.

It would be an impossible task to write such a program.

All I can say is that it's better to learn CSS and do the conversion yourself. I know that's not what you wanted to hear, but that's the truth...

bill

4:29 am on Mar 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



TopStyle has its StyleSweeper that does this to some extent. It will combine duplicate rules, alter selector case and order, and set shorthand properties for font, background, margin & padding.

DrDoc

5:25 am on Mar 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



But that's not Xuefer is asking for, as far as I understand it. There are several programs like that, programs that will clean up your code... but none that will take your CSS and split it up into pretty.css and ugly.css, where ugly.css contains hacks and workarounds for various problems in pretty.css

bill

7:55 am on Mar 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I see. I should have read Xuefer's post more carefully ;)

So a pretty.css would be a base CSS file that would work just about everywhere and ugly.css would be browser specific or page specific CSS? I certainly haven't seen anything that will do that.

victor

8:40 am on Mar 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is there even a list of what:
  • could go in a base.css (ie is fairly harmless and/or universal)
  • should go in an import.css (ie damages NN and so needs to be hidden from it)
  • should be surrounded by bad quote hacks (ie upsets IE's idea of a box)
  • etc
    ?

    I asked a similar question a while back and got no answers. Maybe we could start a list in another thread.

  • Xuefer

    9:13 am on Mar 21, 2003 (gmt 0)

    10+ Year Member



    thank you guys for your replies

    so pity.
    but i guess, if it's able to do by hand, it should able to be done by a program, if some experts wanna do one. even two textbox with 1 button, running with JS in HTML, will be acceptable for use.
    even only do the hack css for ie5.x box module for xhtml strict mode, will be of great help to many many ppl

    many ppl learn css by heart. however, version compact problem will make them disappointed.
    it's the same problem as js/html version compact problem.

    WibbleWobble

    1:00 pm on Mar 21, 2003 (gmt 0)

    10+ Year Member



    Is there even a list of what:
    # could go in a base.css (ie is fairly harmless and/or universal)
    Topstyle (as already mentioned) has a safelist that includes only the following:

    background (color) (url)
    color
    font-style
    font-family
    font-size
    font-weight
    line-height (? never used it myself)
    text-align
    text-decoration
    text-indent

    I guess now we need to expand on that, because there must be some more tags that are very well supported.

    DrDoc

    8:51 pm on Mar 21, 2003 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    line-height is useful if you want to create text 1.5 or double spaced.

    Anyway, there are several other properties that could be added, such as:

    overflow: hidden
    overflow: visible
    display (buggy on NN4)
    padding (except for IE5.x's broken box model)
    position: absolute (even though left/top/right/bottom is buggy on different browsers)
    float (but "clear" is buggy)

    I don't know .. the list is actually quite long .. depending on the element too :(

    DrDoc

    8:54 pm on Mar 21, 2003 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    but i guess, if it's able to do by hand, it should able to be done by a program

    I can do it by hand, almost in my sleep... But I wouldn't be able to write a program/script that would do it for you. See, it's not just the CSS properties themselves. You get different results depending on whether it's a single element, the type of element it is, and what kind of wrapper it has (DIV, P, SPAN... if any).

    It's difficult enough to do it manually when you ahve the source code to look at. But to write a program that would do it for you, no matter the source code... I'd say it is impossible (and I rarely ever say that something is "impossible").

    SuzyUK

    9:41 pm on Mar 21, 2003 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    Have to agree with DOC....

    there's just too many variables, and as soon as you think you've got one sorted out..they release another Browser!

    Suzy