nowfound

Life & fun · March 30, 2013

CW

CSS with no px units

I recently built a new template for my rather basic WordPress blog. I wanted to avoid using px units wherever possible, so that I could have a design that would scale uniformly across multiple device resolutions. It started as an experiment, to see how far I could get without px units. The more I learned, the more excited my campaign to eliminate px from the stylesheet. I ended up eliminating px units entirely. Everything is sized with vw units (relative to the width of the viewport). The last remaining px units were sizing standard Facebook and Twitter buttons. I got frustrated by not being…

What it does

In the maker’s words, at launch

I recently built a new template for my rather basic WordPress blog. I wanted to avoid using px units wherever possible, so that I could have a design that would scale uniformly across multiple device resolutions. It started as an experiment, to see how far I could get without px units. The more I learned, the more excited my campaign to eliminate px from the stylesheet. I ended up eliminating px units entirely. Everything is sized with vw units (relative to the width of the viewport). The last remaining px units were sizing standard Facebook and Twitter buttons. I got frustrated by not being able to control the size of Facebook's Like button and ended up making my own buttons in CSS...with vw units, naturally. The only references to px units are in the media queries, because at this point I know of no better way to responsively serve different style sheets. For now, they don't bother me. Known issues: On a big enough viewport, it starts to get very big. I have no idea what it looks like in Internet Explorer and I don't think I want to know.

Does the same job

all alternatives →
  • IM
    I made a book with a hundred UI/UX tips2021 · ▲198

    Hello. This year I dived into UI/UX area and at the same time I work as a web developer. I sincerely love making good UI. But at my full time job it's not always possible due to different reasons =\ So I've been posting random UI/UX staff on Twitter, then I made a free book that had 50 tips (posted it here as well). I decided to finish this year by collecting everything I learned and here it is: https://akcium.gumroad.com/l/ui-ux-tips. This time it's a paid one. But, you can check ~20 pages of it, just go to…

  • Windows 95 UI kit2016 · ▲245

    Vector UI kit with Windows styles, fonts, and icons

  • 100 CSS Buttons2022 · ▲174

    No conversion happens without the click of a button

  • everysize2020 · ▲207

    Check your responsive webpage in every size 🖥 💻 📱 👀

  • Author2023 · ▲118

    A blog template made with Astro, Tailwind CSS and MDX

  • Bamboo CSS2021 · ▲101

    A classless CSS utility for your HTML

More life & fun this month

the category →
  • TL

    Life & fun · 10d ago · louisabraham.github.io

  • Photosynthesis fires two of your iPhone

    Life & fun · 28d ago · photosynthesis.camera

  • SoloUno310

    Take control of hair pulling, nail biting & skin picking

    Life & fun · 28d ago · solouno.io

  • Scroll through all 43,252,003,274,489,856,000 reachable Rubik's Cube permutations.

    Life & fun · 26d ago · everycube.alen.is

  • The Interactive 3D Encyclopedia

    Life & fun · 21d ago · expeditione.fun

  • Hi HN, I built Eigendrum, a web tool that solves the 2D wave equation for arbitrary shapes so you can hear what they sound like as drums. How it works: * Solves -∇²u = λu using finite element analysis (Kφ = λMφ) on a triangle mesh. * Validated to <0.1% error against closed-form solutions for circles (Bessel zeros) and rectangles. * Sound model factors in strike location, Rayleigh damping, and mallet width. * Includes Kac drums I & II to demonstrate identical sound spectra from different geometries. * No frameworks, build steps, or dependencies. Repo and tests:…

    Life & fun · 26d ago · baselashraf81.github.io

Launched alongside, March 2013

the whole month →