Home / GitHub Page

Random class names

Why are there now random class names in CSS?

Do they change from version to version? Are they the same for every person (or are they different for you and me)?

e.g. I want to remove the markdown/editor buttons image, so how do I do that?

1 Like

I use

 button.tox-tbtn {
	/* removes the WYSIWYG button */
	 display: none !important;
}

and it seems those random looking classes can change with each build.

Thanks for the answer. Which means it doesn't make mucxh sense to add button.tox-tbtn to my css.

Hmm, interesting. Maybe there's a way to tell this sidebar rendering optimization engine not to use random css names.
The problem with selectors is that they might not be unique and thus they would screw up the UI. See this comment.

1 Like

The lib we use is styled-components and I’m not sure there’s an option for more stable names.

We can always add class names ourselves though. I think we should create a list of elements that could use a class name, then once we have the list it’s quite easy to add them to the app.

1 Like

That one has worked for me for all versions since the interface changed. However I can see what you mean in that this may actually be a random-type class so I have just devised one using "standard" elements which seems to do the job.

 div.editor-toolbar div button {
	/* removes the WYSIWYG button */
	 display: none !important;
}

Edit: Also changed it on the wiki page

1 Like

Yes, I have started this list a while ago....

List of CSS elements which should have a class

1 Like

Thank you. I'm always afraid that I click this button by accident, which in turn would most likely fuck up my notes, since I use plugins and formatting not supported by the WYSIWYG editor.
I do have daily backups, but you never know....