Skip to content

Why is className deprecated? #935

Answered by timogasda
AdamJ asked this question in Q&A
Discussion options

You must be logged in to vote

Custom classes are marked as deprecated for Cloudscape components to discourage CSS overrides. The internal HTML and CSS structure of a Cloudscape component can change with a Cloudscape update. If you have CSS overrides that rely on these internals, Cloudscape updates might inadvertently break your UI without you noticing.
If you want to use custom CSS styles, it's expected that you apply them to your own divs (or other HTML elements under your control).

If you're using class names to identify components during tests, we recommend using data test ids.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by timogasda
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants