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

How to get available tags and classes to write custom-styles.js and generate rapidoc-min.js #742

Closed
amandascm opened this issue Apr 28, 2022 · 3 comments

Comments

@amandascm
Copy link

amandascm commented Apr 28, 2022

I have been trying to generate rapidoc-min.js file with custom styles applied to custom-styles.js, as suggested in this documentation of RapiDoc in the section about Advanced Styling - see also the screenshot below.
My question is: is there a way I can list all possible tags or classes and ids that may be used to style my OpenAPI docs rendering with RapiDoc? Is there an example of custom-styles.js with the use of more than few tags in the css content?

image

@mrin9
Copy link
Collaborator

mrin9 commented May 19, 2022

Sorry to reply bit late on this.

If you need to really update the styles inside of RapiDoc try using css-parts
exposed by rapidoc.

It is recommended than the above approach.
The documentation I pointed lists various css parts that you can override by your own styles and also you can avoid building your own copy of rapidoc on your end just for styling.

In case you are interested in changing a section in rapi-doc and not finding a corresponding css-part for it, let me know and I can see if I can expose it out for overriding

If you want to find out if an part is associated with an element, then use the dev-tools and check the element's part attribute

@janu1428
Copy link

HI Mrin,

If we have h2 tag inside section-operation part, can we add custom styles for them? In simple, can we add any styles for elements inside div if div conatins part attributes?

@mrin9
Copy link
Collaborator

mrin9 commented May 24, 2022

No, with css parts you can not target the children. Only the part that's exposed for styling can have user's style, else it will defeat the purpose of style encapsulation.

In this particular case I will add more parts for you to be able to target the h2 tag as I see it may be a common need for many to style that section

Let m know if there are other parts you would like apply your own styling and we will discuss it further in our team if it makes sense to allow override

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

3 participants