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

add styling via class #84

Closed
evgenyfadeev opened this issue Apr 4, 2021 · 3 comments
Closed

add styling via class #84

evgenyfadeev opened this issue Apr 4, 2021 · 3 comments
Labels
question Further information is requested

Comments

@evgenyfadeev
Copy link

evgenyfadeev commented Apr 4, 2021

Maybe it's just me, but I'm unable to do this (an any other styling via "class" or "svg" selector... Is this a bug?

(My setup is with routify).

<style>
   .some-class {
       position: absolute;
       right: 0;
  }
</style>
<Fa class="some-class" icon={faFlag} />
@Cweili
Copy link
Owner

Cweili commented Jun 22, 2021

Try apply your style globally with :global() like this:

:global(.some-class) {
     position: absolute;
     right: 0;
}

Here is the issue.

@Cweili Cweili added the question Further information is requested label Jun 24, 2021
@Cweili Cweili closed this as completed Aug 31, 2021
@kevin4dhd
Copy link

Try apply your style globally with :global() like this:

:global(.some-class) {
     position: absolute;
     right: 0;
}

Here is the issue.

this trick works thank you very much

@janDo-dev
Copy link

janDo-dev commented Feb 8, 2024

Question related to this topic regarding the usage of BEM.

Is there another solution to this?

<div class="block">
  <Fa icon={someIcon} class="block__element" />
</div>

Doesn't work:

.block {
  position: relative;
  
  &__element {
    position: absolute;
    right: 0;

    &--modifier {
      right: 10%;
    }
  }
}

Only Solution(?):

.block {
  position: relative;
}

:global(.block__element) {
  position: absolute;
  right: 0;
}

:global(.block__element--modifier) {
  right: 10%;
}

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

No branches or pull requests

4 participants