Daniel Glazman: Implementing Media Queries in an editor |
You're happy as a programmer ? You think you know the Web ? You're a browser implementor ? You think dealing with Media Queries is easy ? Do the following first:
Given a totally arbitrary html document with arbitrary stylesheets and arbitrary media constraints, write an algo that gives all
h1a red foreground color when the viewport size is betweenminandmax, whereminis a value in pixels (0 indicating nomin-widthin the media query...) , andmaxis a value in pixels or infinite (indicating nomax-widthin the media query). You can't use inline styles, of course.!importantcan be used ONLY if it's the only way of adding that style to the document and it's impossible otherwise. Oh, and you have to handle the case where some stylesheets are remote so you're not allowed to modify them because you could not reserialize them
What's hard? Eh:
My implementation in BlueGriffon is almost ready. Have fun...
| Комментировать | « Пред. запись — К дневнику — След. запись » | Страницы: [1] [Новые] |