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 CSS classes to ngx-contentful-richtext component and to renderers #9

Conversation

guillaume-moreau
Copy link

Fixes #8

It adds a class name to NgxContentfulRichTextComponent DefaultMarkRendererComponent TextValueComponent and DefaultNodeRendererComponent.

I needed these class name for my project in order to add some custom CSS rules.

The class names may not be good, I can change this if needed.

Thank you =)

@guillaume-moreau
Copy link
Author

Hello @kgajera , is the PR ok for you ?
Is there anything I can do ?

Copy link
Owner

@kgajera kgajera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Palapapaa! Thanks for this contribution.

I tested this out but I don't see how this will make it easier to add styling. For example, the changes in this PR would add classes like this:

<ngx-contentful-rich-text class="ngx-contentful-rich-text">
  <p>
    <ngx-contentful-rich-text class="ngx-contentful-rich-text">
      <ng-component class="text-value">paragraph works!</ng-component>
    </ngx-contentful-rich-text>
  </p>
</ngx-contentful-rich-text>

So you could add styling like this:

.ngx-contentful-rich-text p {
  font-weight: bold;
}

But how is that an improvement over adding styles without using classes:

ngx-contentful-rich-text p {
  font-weight: bold;
}

@kgajera kgajera force-pushed the master branch 2 times, most recently from f8b2e5e to 38e3e9d Compare June 12, 2022 01:21
@kgajera kgajera closed this Oct 10, 2022
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

Successfully merging this pull request may close these issues.

Feature Request: add css classes to renderer so that they can be styled
2 participants