-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
better css class names #46
Conversation
jantimon
commented
Jan 19, 2024
•
edited
Loading
edited
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
CodSpeed Performance ReportMerging #46 will not alter performanceComparing Summary
|
* @param {number} i | ||
*/ | ||
function unreadableNumber(i) { | ||
return i.toString(25).replace(/\d/g, (m) => (Number(m)+26).toString(36)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need such a "complicated" logic for this problem. At the moment it generates strings beginning from "q" instead of "0" and iterates through the alphabet. Can we just start with "a" if numbers are to distracting? Or keep it simple and a number for the moment 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's like a hex algorithm but without numbers - but yes probably to complicated 😄
0 'q'
1 'r'
2 's'
3 't'
4 'u'
5 'v'
6 'w'
7 'x'
8 'y'
9 'z'
10 'a'
11 'b'
12 'c'
13 'd'
14 'e'
15 'f'
16 'g'
17 'h'
18 'i'
19 'j'
20 'k'
21 'l'
22 'm'
23 'n'
24 'o'
25 'rq'
26 'rr'
27 'rs'
28 'rt'
29 'ru'
30 'rv'
31 'rw'
32 'rx'
33 'ry'
34 'rz'
35 'ra'
36 'rb'
37 'rc'
38 'rd'
39 're'
40 'rf'
41 'rg'
42 'rh'
43 'ri'
44 'rj'
45 'rk'
46 'rl'
47 'rm'
48 'rn'
49 'ro'
I guess instead of making the number less readable we should try to remove the number whenever the class name exists only once in the file. So I reverted the I also added tests |
Strongly agree with your take and thank you for the additional tests :) |