Settings

Theme

What if we ditched CSS?

2 points by relfor 10 years ago · 6 comments · 1 min read


Clock: http://codepen.io/relfor/pen/eJZQab?editors=001

TodoMVC: http://codepen.io/relfor/full/VeaVNe/

Hello World: http://codepen.io/relfor/pen/bEpONL?editors=001

Drawer Menu: http://codepen.io/relfor/full/BjKvNm/

MattBearman 10 years ago

While they're cool demos, you've definitely not ditched CSS, the markup is full of style attributes

  • relforOP 10 years ago

    Hey, The CSS in markup is only for the TodoMVC demo. It contains styling of the placeholder psuedo selector, and inline styling of a link to override the default style of a link.

    The other 3 demos do not have CSS.

    • 5h 10 years ago

      This is the number 11 from the clock

          <div style="position: absolute; display: block; visibility: inherit; margin: 0px; padding: 0px; backface-visibility: hidden; box-sizing: border-box; transform-style: preserve-3d; overflow: hidden; outline: none; border: none; font-size: 28.44px; font-family: sans-serif; color: black; text-decoration: none; text-align: left; direction: ltr; line-height: 1.4em; white-space: nowrap; -webkit-font-smoothing: antialiased; cursor: default; transform: translate(50.834px, 12.5738px); -webkit-user-select: none; height: 39.816px; width: 32px;">11</div>
      
      Nope, no css here.
      • relforOP 10 years ago

        Oops I thought you meant within the HTML file itself.

        CSS means "Cascading Stylesheets" Using the framework the developer does not have write CSS. What you pointed out is the "style" attribute. Obviously the engine has to use the "style" attribute to communicate to the browser about the positions and remaining computed style properties.

        • 5h 10 years ago

          Your post said "What if we ditched CSS?" with zero other context.

          The links do use CSS, and there are non css options available in most rendering engines for such things, e.g. canvas/svg.

          Personally I see no advantage to using things like lay.js in the top linked example over SVG, and further feel that a lot of the hate driven towards CSS stems from misunderstanding or misuse. Not that it is perfect, far from it, but to proxy it behind another language can only ever add limitations.

          Compass/SASS solve most of my shallow verbosity based gripes tbh.

        • seekingcharlie 10 years ago

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection