DOMming for stylesheet properties

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jam Pa

    DOMming for stylesheet properties

    Hi there javascript fiends

    If you had to return all 'font-size'-properties from a stylesheet, how
    would you do it?

    Or in more generic fashion, what kind of solution would you code for
    fetching all instances of a particular property in a stylesheet?

    I'm thinking one has to iterate through the document.style tree, and if a
    property is found, its added into a result-array...
  • DU

    #2
    Re: DOMming for stylesheet properties

    Jam Pa wrote:
    [color=blue]
    > Hi there javascript fiends
    >
    > If you had to return all 'font-size'-properties from a stylesheet, how
    > would you do it?
    >
    > Or in more generic fashion, what kind of solution would you code for
    > fetching all instances of a particular property in a stylesheet?
    >[/color]

    This could be done with DOM 2 CSS methods.
    [color=blue]
    > I'm thinking one has to iterate through the document.style tree, and if a
    > property is found, its added into a result-array...[/color]

    What exactly are you trying to achieve? If you want to dynamically
    modify the font-size of a document, then best is to just use relative
    font-size in your document and let the user use the already available
    command of his browser.

    W3C Quality Assurance tip for webmaster:
    Care With Font Size
    "Do not specify the font-size in pt, or other absolute length units.
    They render inconsistently across platforms and can't be resized by the
    User Agent (e.g browser).
    Use relative length units such as percent or (better) em"


    DU
    --
    The site said to use Internet Explorer 5 or better... so I switched to
    Firefox 1.0.4 :)

    Comment

    • Jam Pa

      #3
      Re: DOMming for stylesheet properties

      DU <drunclear@hotN OSPAMmail.com> wrote in
      news:3glsuaFd3c cnU1@uni-berlin.de:[color=blue]
      > This could be done with DOM 2 CSS methods.[/color]

      Really?!?!? WOW!! Good job, Einstein!
      [color=blue]
      > What exactly are you trying to achieve?[/color]

      I wrote that in the first post. Quoted below:
      [color=blue][color=green]
      >> If you had to return all 'font-size'-properties from a stylesheet, how
      >> would you do it?
      >> Or in more generic fashion, what kind of solution would you code for
      >> fetching all instances of a particular property in a stylesheet?[/color][/color]

      Now, does anyone actually have ideas or experience to share on this?
      [color=blue]
      > W3C Quality Assurance tip for webmaster:
      > Care With Font Size
      > "Do not specify the font-size in pt, or other absolute length units.
      > They render inconsistently across platforms and can't be resized by
      > the User Agent (e.g browser).
      > Use relative length units such as percent or (better) em"
      > http://www.w3.org/QA/Tips/font-size#goodpractice[/color]

      ANY decent coder or webdesigner knows NOT to follow that rule as 'em' or
      percents will F*CK UP your layout bigtime so that you cannot create 'cross
      browser consistent' layouts. Now how about you go preach someplace else and
      reply *only* if you have something to reply on the topic of this thread.
      Danke.

      Comment

      • Randy Webb

        #4
        Re: DOMming for stylesheet properties

        Jam Pa wrote:[color=blue]
        > DU <drunclear@hotN OSPAMmail.com> wrote in
        > news:3glsuaFd3c cnU1@uni-berlin.de:
        >[color=green]
        >>This could be done with DOM 2 CSS methods.[/color]
        >
        >
        > Really?!?!? WOW!! Good job, Einstein![/color]

        You are about 100 years off the mark.
        [color=blue]
        >[color=green]
        >>What exactly are you trying to achieve?[/color]
        >
        >
        > I wrote that in the first post. Quoted below:[/color]

        But you failed to explain what your end results/intentions were. To
        phrase it gently for you, your question was too generic.
        [color=blue]
        >[color=green][color=darkred]
        >>>If you had to return all 'font-size'-properties from a stylesheet, how
        >>>would you do it?
        >>>Or in more generic fashion, what kind of solution would you code for
        >>>fetching all instances of a particular property in a stylesheet?[/color][/color]
        >
        >
        > Now, does anyone actually have ideas or experience to share on this?[/color]

        Yes, and you got some good advice that you chose to ignore. Since you
        ignored it and attempted to flame it, I will keep my advice to myself
        also. I actually have experience doing something close to what you
        vaguely described. Maybe if you repost your question not so vaguely you
        might get an answer.
        [color=blue]
        >[color=green]
        >>W3C Quality Assurance tip for webmaster:
        >>Care With Font Size
        >>"Do not specify the font-size in pt, or other absolute length units.
        >>They render inconsistently across platforms and can't be resized by
        >>the User Agent (e.g browser).
        >>Use relative length units such as percent or (better) em"
        >>http://www.w3.org/QA/Tips/font-size#goodpractice[/color]
        >
        >
        > ANY decent coder or webdesigner knows NOT to follow that rule as 'em' or
        > percents will F*CK UP your layout bigtime so that you cannot create 'cross
        > browser consistent' layouts.[/color]

        Oh humpty dumpty bullshit. Wait, the decent ones might not follow that
        rule. But the really good ones always do. So, I guess you are right on
        that one.

        --
        Randy
        comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
        Answer:It destroys the order of the conversation
        Question: Why?
        Answer: Top-Posting.
        Question: Whats the most annoying thing on Usenet?

        Comment

        Working...