A CSS only slider (no JS)(significa.pt)

almost 5 years ago from Rui Sereno, Partner @ Significa.co

  • Colm TuiteColm Tuite, almost 5 years ago

    I've never understood people replacing Javascript by hacking form inputs. This is a pointless hack - this is not what form inputs were designed for. Also, if you add or remove a card, you need to tweak the CSS.

    What's wrong with Javascript anyway? Javascript is a beautiful, performant language. This is just poor engineering.

    9 points
    • Rui Sereno, almost 5 years ago

      Hello Colm, You're definitely correct. Nothing wrong with Javascript. The thing is there's a lot of people who struggle with JS and are quite comfortable with CSS. This hack is for them. Nonetheless, thanks for your comment.

      3 points
      • chris limbrick, almost 5 years ago

        Another point to add, using CSS like this is a great way to add interactivity for sites that have javascript disabled, i.e. .onion sites using the Tor Browser.

        2 points
      • Colm TuiteColm Tuite, almost 5 years ago

        Well yeah I get that it's to appease beginners, it's just that your solution is so needlessly complex and as Alex noted - much more complex than the relatively simple few lines of JS required.

        Ultimately, it's just bad code and I don't like encouraging beginners down this path. I think it would be great if the article came with a very basic JS solution at the bottom, which might encourage beginners to give it a try.

        3 points