Showing posts with label web design. Show all posts
Showing posts with label web design. Show all posts

Tuesday, March 19, 2013

Playing some catch-up on the web, hitting gotchas on the bleeding edge

Ever since I got a first set of static web space on GeoPages back in '97, I've been playing around with designs, on and off. So I went through the phases of frame-sets, and then table based layouts and Java applets, before getting to the bleeding edge ten years ago and doing the whole semantic XHTML1.1, CSS, minimal JavaScript thing, applets in <object> tags, while still having to provide graceful degradation to Netscape 4 and passing conditional CSS with JavaScript fixups to IE6. (The current blog layout is really a spin-off from the sort of design I was playing around with at about the time I started blogging).

Then there was jQuery, and I did a little bit with that, like accordions to cut the space occupied by what had been growing heavily styled nested lists full of links. Oh, and scripting for the rounded corners too. And then <canvas> in some browsers, while having to feed SVG or VML to the rest either explicitly or through a wrapper library.

But that was all a while ago, and I felt it was time to start playing with the new things we can do that had been passing me by -- HTML5/CSS3, more semantic mark up, webfonts rather than image-substitution, with symbol fonts for icons, CSS3 effects (so we can do script free accordions like we used to do script-free drop-downs) -- and see what we can get away with these days, which changing the rather stale aesthetic of textured backgrounds and hard delineations.

So, getting to the point, I hit a CSS3 gotcha when trying to push the envelope. What I was after was to style a navigation list with a symbol font right-arrow in a circle at the start. So I tried this:

And I was disappointed to see Firefox render a little circle, then a placeholder glyph from the text font in use, then the list content -- whereas IE9 did exactly what I wanted, and Opera 11.6 drew a square around the arrow rather than a circle, even though all three browsers draw an arrow in a circle if I put the appropriate HTML escape in a span and style that. After some experimentation, it seems that Firefox will not put the glyph in the border, nor use the symbol font, for symbols in the private use area unicode range. And Opera 11.6 will use a square outline regardless.

So I can have a pure CSS solution with not quite the glyph I want, and in some browsers, not the outline; or I put the symbol I want in explicitly or by script. Or maybe some combination.

Still have to try it in a Webkit browser, mind you.

Later: experiments with other code points (abandoning the symbol font) shows that letter forms do get circled by this technique in Firefox, but symbol ranges e.g. Mathematical Arrows don't.

Even later: Chrome, as a representative webkit, doesn't show any glyph at all -- just the border! Looks like I might have to do this by script.

Even later yet: I ended up doing it with an image.

Saturday, October 03, 2009

SyntaxHighlighter 2.0 Brushes for F# and Erlang

Updating the Erlang brush

This also required the following in the CSS theme


And for F#


which is as incomplete as it always was; but doesn't use any extra CSS.


Later -- another brush for F# that was published at about the same time can be found at Pense-Moi.

Migration to SyntaxHighlighter 2.0

This will be coming soon. For the moment a little note to myself, expanding from my first how-to for version 1.5:

becomes


To get the legacy mode to work, I had to put the initialization into the onload function.

I'm not rolling this out until I can get the rewritten F# and Erlang brushes to work and not throw _a2.regex is undefined messages.

Later: There are a lot of initial-letter capitalization changes (in both directions) required in this port : the "_a2.regex is undefined" messages came from more of them than at first met the eye. I still can't find the equivalent mechanism to injecting CSS styles, though.

Later yet: There doesn't seem to be a programmatic injection of CSS values any more, so I hacked the values from the 1.5 brushed into the default CSS file.

Even later: To allow legacy and non-legacy highlight styles, the legacy part of the operation must be in the onload, the 2.0 initialization must not.

Yet more: A possible bug in the CSS as supplied -- I needed to add the following

to shCore.css to get the copy-to-clipboard icon to show in the toolbar.

Tuesday, September 15, 2009

Moving the immovable -- that McAfee SiteAdvisor toolbar in Firefox

Actually it does seem to be immovable -- I've tried a number of techniques (floats, CSS-positioning, CSS-transforms) and haven't been able to just simply move the control one pixel, let alone to somewhere less intrusive within the toolbox element.

Hiding it without disabling I can do. Here's how:

In your ...Application Data\Mozilla\Firefox\Profiles\..profile..\chrome folder, add the following UserChrome.css

Restart Firefox, and the waste of vertical space is gone.

You can tell how well crafted the control is, when you look at the XUL and see that it's a toolbaritem naked in the toolbox, rather than actually being in a toolbar.

Thursday, August 13, 2009

Improved Syntax Highlight Brush for Erlang

Updating last December's post, about a SyntaxHighlighter brush for Erlang, to allow for compounds like 'wxErlang' with interior capitals and not mark them as values:

This manipulates the output of the RegExp to discard the first (non-identifier) character, to work around the lack of lookbehind (in one of the many possible ways the same effect could be achieved).

Monday, December 01, 2008

Amused

The SEO benefits of clean web design emerged in thread on /a/ over the weekend. Apparently my NGE fan-site comes very high up Google search.

This emerged in the context that some who feel that my opinions are not so much heterodox as heretical were uncomfortable that my writings should be so easily stumbled across by newcomers.

Nothing stopping them writing their own sites with cleaner design, though.