DEV Community

Discussion on: The ONE star rating system — the future of rating

Collapse
 
dannyengelman profile image
Danny Engelman • Edited

There are nine million bicycles in Beijing
That's a fact
It's a thing we can't deny
Like the fact that I will love you till I die

That is what Katie Melua sang in 2008 : youtube.com/watch?v=eHQG6-DojVw

I have the utmost respect for people doing great stuff with HTML+CSS only

Then again, I have the utmost respect for people riding uni-cycles.
There might be 9 million bicycles in Beijing,
there are about 22 million bicycles here in the Netherlands (aka Holland).
And I have yet to see one person riding a uni-cycle to work.

Websites without any JavaScript are possible; but let us be honest.. that is like riding a uni-cycle.

You don't want users messing around with N lines of (error prone) HTML and M lines of (error prone) CSS when all you they have to do is:

<one-star-rating value=3></one-star-rating>
Enter fullscreen mode Exit fullscreen mode

The <one-star-rating> Web Component

Using JavaScript to create a Custom Element with shadowDOM allows for optimized HTML/CSS

  • no need for a .star class
  • no need for a <div>
  • no bloated whitespace
  • no need for double-quotes on attributes
  • and I probably missed more

Here is all code required:

Buy a uni-cycle

If you really want one, here is a good site: hollandbikeshop.com/en-gb/children...

As you can tell from the URI, not many adults buy uni-cycles here in Holland.

But what about an N-star rating?

Here is my 2-wheels version: dev.to/dannyengelman/twinkle-twink...

Star wars... ROTFLMAO

biddi biddi biddi

Collapse
 
afif profile image
Temani Afif • Edited

I am never against the use of JS ;) I simply want to push the limit of CSS to see what we can do with it and I agree that the idea of web component is good.
I already saw your other post, too bad it didn't get a lot of success.

Some comments have been hidden by the post's author - find out more