Skip to content

2 bytes shaved for the non-ES6 #2

@BitByBen

Description

@BitByBen

I believe this would work. Bored. So, I obviously I had to use Regex.

Uses the className and splits the classes and the -'s in the same go.
Pops the values on the end in sets of 2.

for(t=document.querySelectorAll`*`,i=t.length;i--;)for(s=t[i].className.split(/[- ]/);s.length;)u=s.pop(),t[i].style[s.pop()]=~~u?u+'px':u

First pass. Might mess around later.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions