-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Is this possible to obfuscate "hover:" class name or something like that from TailwindCSS? I also have some question and feature request #6
Comments
What a fantastic issue format! I really appreciate your enthusiasm and contribution to this package.
|
Plus, if you have a test project for this, would you mind to share with me? |
Thank you for reply!
If you can really do this, this will be a huge boom for your package. #waitingforamiracle |
Yes, fixing the bugs is my top priority right now. Regarding the feature request,
|
[#] Better action pseudo-class handling [+] Able to filter out vendor pseudo-classes [+] Able to handle Tailwind CSS selector's number with "." and "/", eg. "ml-0.5", "ml-1/2" [+] Able to handle Tailwind CSS negative selector, eg. "-ml-1" [+] Able to handle [attribute / Tailwind CSS custom parameter] selector
Yeah if you can actually delete exactly the OBFUSCATED TW classes then maybe there won't be any problem 🫡, otherwise you can try making a beta version of the package for example. But I think you can fix the other problems first and then remove the old TW class problem for the end. |
[-] Removed `customTailwindDarkModeSelector` Option [#] Updated Unit Tests
@hoangnhan2ka3 The beta version is ready!
Looking forward to your feedback~ |
hi there @soranoo =)))) This my first look about the fix of Wait for me for full feedback, looks very interesting 💣 |
Investigation Report
Feature Update
New README |
I'm extremely honored to be tagged in the README ✨. And I'm surprised by the structure of your code after this change quite a bit, thank you for your effective efforts 🎉. There are actually a lot of improvements, especially with the You also fixed the problem bb90dd0#commitcomment-138032346 which is noice 💕💕. Ok now let's get to the main point. 👉 1. The Biggest One
|
It seems more correct then ~ @soranoo Before: After: ✨ I don't see classes that should not be duplicated anymore. But what happen with the |
Tailwind Universal Selector
|
✨Report to commander @soranoo , mission success ! I've been trying with |
Let's have a final beta before release!
I had added/merged some options. Btw |
Okayyyy newwww buggggg:
U see In production, it will look like this if no obfuscation: Please refer to Nextjs local fonts I tried not including And when run this package: In normal pages ✅: In 404 page ⛔(a.k.a not-found.tsx page) : Yes, fonts have not been applied. In previous comments, I put
|
try put |
okay I just updated with I also just tried with some other Result: Thanks @soranoo 💕! |
I guess yes... I will add this to the doc |
After some testing, I decided not to edit the regex since the javascript obfuscation will messed up by that |
That's okay, don't try too hard |
For a temp fix, add the following to the class conversion json, {
// ....
"..big": ".big",
} |
That's not called a natural deployment, right? Okay, I'll live with |
Yes, directly editing the conversion JSON is not recommended. Btw can I mention your site in the dome section? |
Ok, but let me provide another domain with same content, cuz I will use hoangnhan.uk for more deployment. U can use hoangnhan.co.uk, I will update it in a minute |
hoangnhan.co.uk is ready @soranoo, I just wait for new npm package to update and u can mention it. or when I finish my project on my main domain hoangnhanne.id.vn, you can mention it too :D. |
Please notify me when your site goes into production! Looking forward to your fantastic work. |
It's just a 100dvh website haha 🤡 |
@hoangnhan2ka3 The |
First of all, I really appreciate your efforts on this project ✨, thank you @soranoo and all Sponsors !
This is almost what I needed, really easy to use, really full features and highly customizable.
Besides, it also helps my code look mysterious 😈 and professional.
I want to make some contributions to make this project even more perfect, to be widely known and to be a perfect replacement for a certain "no longer maintained package" named Post*** 😄.
My specs:
👉 1. Also obfuscate something like "hover:" in TailwindCSS class:
There are things that are really easy to confuse like
*:hover
in normal CSS andhover:*
in TailwindCSS class, both havehover
and:
.In my test project, I have ONLY one class end with
"...text-yellow-300"
(I mean there is no other class named "yellow") like this:And when
npm run build
, incss-obfuscator/conversion.json
file:(I also delete
.next/cache
folder and oldcss-obfuscator
folder, which containconversion.json
before running this build command).Result:
In expected:
But no. So... I don't know what is the
:hover
suffix (which is the main problem) when detecting that class name 🥲. And why it detect another alone class".text-yellow-300"
which doesn't exist.Actually, I found a temporary solution when editing your
utils.js
file in thenode_modules
folder, I will talk about this problem in part 2.👉 2. The problem of
selectorClasses.length > 1
:I think part of the problem lies in this line of
utils.js
:next-css-obfuscator/src/utils.ts
Line 801 in 480fbb1
When I edit it to
selectorClasses.length >= 1
, this is the result:"Nears". But of course this does not work ⛔ too because of wrong class detected with
:hover
suffix.Doesn't stop there, this edit also affects "single character" then "-[${custom parameter}]"
eg:
z-[9999]
,min-h-[80rem]
, etc. (almost all)With
selectorClasses.length > 1
:With
selectorClasses.length >= 1
:Almost every TW custom parameter class except
hover:
works perfectly (for me) withselectorClasses.length >= 1
. And Irun dev
,run build + run start
ordeploy to Vercel
with no error (I haven't tried all the TW classes and don't know if there are any special cases or exceptions, but this works for me for now)🫶 If possible, please update an option for this
selectorClassesLength
as a temporary solution for custom parameter TW class.👉 3. Truth about select direct child "*:":
If u know u know:
Even though this
*:
class exists in the parent div, it really only has an effect on the children div.I'm really not sure what will happen if we successfully obfuscate this⁉️
*:
classI think it's possible but quite difficult to do hmmm...
The script is to just obfuscate the
.\\*\\:font-extrabold
part and I thinkwill do the rest.
Okay and... the remain problem of
*:
is same same ashover:
It is true that it must be
.\\*\\:font-extrabold > *
to work but we don't need to detect the> *
part but.\\*\\:font-extrabold
right?At last I do think that fix the
hover:
problem is much possible than*:
haha 😄.👉 4. Feature request:
You know 👉👈... I think this feature is not useless but it's really not as useful as doing the opposite. I mean the tag with marker class will not be obfuscated, it is more valuable to use than having to add a marker to each tag you want to obfuscate, but yes, don't delete the current option because it is usable in some cases. Is it possible?
And once again I really thank you and everyone who has contributed and built this project, please continue to develop it further 🥳.
The text was updated successfully, but these errors were encountered: