InstaCSS: the CSS docs you always wish you had
instacss.com
instacss.com
Since then I've added a few features, one of which being the ability to have permalinks so that you could use it as a google chrome search. This is why I push to the url bar as you type. I'm really open to feedback on how to do this without screwing with people's back buttons, since I agree that's pretty bad.
A different take would be to never automatically push the results to the url bar, but still parse the address bar for queries, and provide a permalink for each result with the hash in it.
The way I solved this in a similar auto-complete app was using a setTimeOut to prevent updating or requesting data unless no key had been pressed in the last 0.2 seconds or so:
var updateId = 0;
function searchKeypress(e) {
if ((e || window.event).keyCode == 13) {
updateCookie(radioStations.selected);
document.location = radioStations.selected.links[0].url;
}
clearTimeout(updateId);
updateId = setTimeout(searchUpdate, 200);
}
Disclaimer: this piece of code is about 4 years old and as you can see it doesn't even use jQuery, but I trust it demonstrates the principle well enough.Data is scraped mostly from MDN using node-scraper and then thrown into mongodb for storage.
Backend is also node and just provides a json endpoint for pulling the entire db client-side (along with serving up index.html and all the client-side js).
Frontend is all backbonejs, which makes writing the search function pretty insanely simple: https://github.com/rgarcia/instacss/blob/master/static/js/vi...
Both backend and frontend code is organized using requirejs, which I am pretty much in love with.
Second is, maybe you should have a sidebar on the right that shows you clickable / keyboard navigatable titles of all the search results so I don't have to scroll down browsing.
* Default to sort by relevence: Put the more relevant matching properties at the top. For example, I type "backg" instead the highest result being the obscure "-webkit-background-composite" ... actually most relevant result "background" which should be the first result instead of the third.
* Default results list to condensed format: Instead of showing the full verbose docs for every matching result instead show a sparse summary of each result with a option to expand it. If there's only one matching result then show the complete doc for it
* Nice example palette for standard colors. How about an example palette for the standard font families?
I would also like it if the search box was in the fixed header, so I don't have to scroll back to the top to re-search.
Otherwise nice tool!
Takes regular expressions as user input. Probably DOS'able.
After looking at it for a few seconds, I realised that it's doing the regex matching on the client side, so it's ok.
If you ever accept arbitrary regular expressions as user input, be very careful: https://www.owasp.org/index.php/Regular_expression_Denial_of...
Edit: ugh, that doesn't actually work. It only gives you p-z. Hey instacss! Please provide us with a link to the actual document. Preferably in plain HTML so we can download it. Alternately, anybody care to scrape this thing and post it in full?
;; ANSWER SECTION: www.instacss.com. 300 IN CNAME http://morning-warrior-3377.herokuapp.com/.
CNAME accepts only hostnames or (depends on your RFC-acceptance-level) a FQDN. No URI/URL
edit: Apparently if you've searched something before it does display it on page load (after a brief delay)? So it seems this link might not be a good example URL. But hopefully you can just edit the URL and submit it directly to see what I'm talking about.
*Support for multiple, comma-separated, background images was added in Gecko 1.9.2.*
but I wish it showed what fraction of web users that represents. Maybe with a little green/red fuel gauge icon.also - the automatic URL hashing of the query breaks the back button to a ridiculous degree.
cool content, bad design.
So there is nothing wrong with choosing to not support 2 out of every 100 users; that's simply a time/cost assessment. What's wrong with you?
[1] http://developer.yahoo.com/blogs/ydn/posts/2010/10/how-many-...
It's OK to develop for your target audience, right?
Of course this doesn't apply here, but I wanted to be dramatic. Should be piece of cake to just show the full content if javascript is off, since it is already loading all of it.
> The point is that it's trivial to make a site like this usable without JS, with little effort. You just have to start with the right mindset.
How are you supposed to make a instant search usable without JS?
If it doesn't need to be instant, just normal search with a nice GET /search?q=border, one would have to program a server side script to do that search.
Or maybe you'd just want to show the whole reference on the HTML, then the JS would have to use that to do the search and hide/show the appropriate div, or you'd have to load everything twice (once in the HTML body and again via ajax). Even then, what's the point? It's a instant search. If the user can't use the only feature of it, he's better off googling.
Is there other way that I'm missing? I don't see that as "trivial".
document.getElementsByTagName('html')[0].className += ' js'
.js #search-results { display:none; }
That's basically all you need.The point is that it's trivial to make a site like this usable without JS, with little effort. You just have to start with the right mindset.
These days, both of the major mobile browsers use WebKit and have great JavaScript support, though they may not support bleeding-edge browser functionality quite yet (for which all non-demo sites definitely need fallbacks). The unofficial mobile browsers have great JavaScript too. Consoles have decent browsers with decent JavaScript, and in any case not all sites need to expect console browsers as a remotely common case.
You have to draw the line somewhere, and not all sites need to support Lynx, Links, or Mosaic. I certainly agree that having decent fallbacks for a site like this doesn't require that much effort, but not all functionality supports graceful degradation.
These days, browsing without JavaScript seems less likely to indicate an older browser, and more likely to indicate a user with JavaScript intentionally disabled using something like NoScript. That user may get righteously offended that a document would dare to run code on their system, but that doesn't necessarily make them right.
All web features tend to follow a three-step lifecycle: too new to use at all except for demos, stable enough to use with fallbacks for older browsers, universal enough to use without fallbacks. Depending on your site and your target audience, basic JavaScript may fall in the second or the third category.
Anyway, it's just a couple of extra lines of code, get over it :)
However, many sites use more advanced JavaScript features which do not necessarily allow for graceful degradation.
(Also, most other mobile browsers of the type you allude to consist of barely more than WAP; only the simplest of non-interactive websites has any hope of working with them. And many sites simply won't have any of those users in their target audience.)
Cut him some slack! I harbor many doubts re: your competence in the realm of friendliness.
There's got a be a more polite way to phrase that.
Also, while I understand the reasons for disabling JavaScript generally, is this really something to get that upset about?
My reactions to broken-without-JS sites spring from security, privacy, usability, and accessibility concerns. "Sites that completely break without JS" is a category that strongly correlates with "sites that have major issues in at least one of those four categories."