SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Faster dynamic css sheets

    I'm using dynamic css sheets. What I'm currently doing is reading a normal css sheet as a text file, then using regular expression to change all the size values and outputting the resized css.

    Would it be faster to put a resizing function in the asp page that outputs the css, rather than using regexp to change a stylesheet? something like this....
    Code:
    <%
    Function resize(n)
    resize=Int(clng(n)*(size/12))
    End Function
    %>
    h1{height:<%=resize(20)%>px;width:<%=resize(200)%>px;}
    #firstDiv{height:<%=resize(120)%>px;width:<%=resize(200)%>px;}
    ..............
    ..............
    etc
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if

  2. #2
    Phil fillup07's Avatar
    Join Date
    May 2002
    Location
    Jacksonville, FL
    Posts
    1,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Although you have not posted your RegEx example, I would most definately think that outputting it correctly the first time via ASP is faster


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •