Skip to content
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 there a way to add custom classes to elements? #48

Open
MD-AZMAL opened this issue Feb 21, 2021 · 3 comments
Open

is there a way to add custom classes to elements? #48

MD-AZMAL opened this issue Feb 21, 2021 · 3 comments

Comments

@MD-AZMAL
Copy link

MD-AZMAL commented Feb 21, 2021

For example if i want to add 'mycustomclass' to a Div

something like this is not possible
<Div className='mycustomclass' />

@LucaMoro96
Copy link

Acqually I use className and it works!

<Div d="flex" justify="center" className="Acquista">

This code becomes:
image

@MD-AZMAL
Copy link
Author

Acqually I use className and it works!

<Div d="flex" justify="center" className="Acquista">

This code becomes:
image

Doing so worked for me but a lot of styles are overwritten by style reset, and a lot of properties don't work as expected.

For example,
style

.test {
    background-color: #0ff;
    font-size: 200px;
}

Component

  <Div  className="test">
            Hello
   </Div>

The output is as follows:
dsfsd

But it is supposed to be something like this, i had to remove <StyleReset /> to get the this but doing so also removes the atomize styles:
asdasd

I'm not sure how to fix this, also if I keep a

tag inside

after giving custom class, the styles of

overwrites my custom class.

@LucaMoro96
Copy link

I've never tried external CSS because I used to change styles inside Atomize tags like I post in my last comment.

But if you don't want to change the styles within the component, you can try adding !important to your custom CSS like this:
.class { color: red !important; }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants