SOLID CSS

CSS was meant to style academic documents and simple sites (eg. wiki, blogs) where the cascade and descendant selectors makes a lot of sense. Unfortunately many sites we build nowadays are way more complex than that, and what used to work on simple projects doesn’t scale very well. We need to find smarter ways to code CSS to avoid the common issues and re-think the way we do our work. We should learn from the experience of other devs working in different domains, and apply into our own domain. Things like separation of concerns, modularity, encapsulation, DRY can (and should) be applied to large scale CSS projects as well. The main problem is that most people who are good at CSS doesn’t necessarily have a Computer Science background, most of them started as designers and learned CSS by themselves (that was my case¦). That’s the main reason why I’m writing this post. I won’t get into too much details/examples but will try to explain briefly each concept. Some of the SOLID principles are open to multiple interpretations on the CSS context - since we are shoehorning the concepts - that’s one of the reasons why I decided to not give detailed examples. I also think we should understand the idea and not be tied to a specific implementation. ...

9 de octubre de 2012 · 2 min · 223 palabras · Nacho Cano

Applying Macrotypography For A More Readable Web Page

Any application of typography can be divided into two arenas: micro and macro. Understanding the difference between the two is especially useful when crafting a reading experience, because it allows the designer to know when to focus on legibility and when to focus on readability. This article focuses mostly on a few simple macrotypographic techniques”with a dash of micro”and on how to combine them all to build a more harmonious, adaptable and, most importantly, readable Web page. ...

28 de mayo de 2012 · 1 min · 79 palabras · Nacho Cano

Can’t Get Into Preprocessors? Try Zen Coding

A ton of discussion lately has been given to preprocessors. These incredibly useful tools make coding easier, faster and more maintainable, but they’re certainly not for everyone. Whether or not you’ve jumped on the preprocessor bandwagon, you should give a fresh look to an old favorite that helps you dramatically cut your coding time without reinventing your workflow with compilers and other complications: Zen Coding. » designhack.net

23 de mayo de 2012 · 1 min · 67 palabras · Nacho Cano

Imágenes embebidas en el código HTML, CSS o JSON

Mediante esquema data:URI se pueden incluir imágenes codificadas en base64 en el CSS de una página o en el src de una etiqueta img como si fueran fuentes externas. También se pueden introducir otro tipo de datos, como por ejemplo, código HTML. <img src="data:image/png;base64,iVBORw0KGgo[...]QmCC" title="image" alt="image" /> También se puede utilizar en un JSON: { "image":{ "data_uri":"data:image/png;base64,iVBORw0KGgo[...]QmCC" } } Las ventajas de utilizar este método son que no se necesitan abrir conexiones adicionales para decargar los datos, ya que toda la información está incluida en el propio archivo, con lo que dejan recursos disponibles, algo que puede ser especialmente útil en redes inalámbricas muy saturadas o lentas, como algunas redes de telefonía móvil, y se crean menos entradas en la caché del navegador. Además, al estar incluidos en el código se pueden cachear. ...

6 de marzo de 2011 · 2 min · 343 palabras · Nacho Cano