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

feat(v2): allow to define custom CSS class for Tabs component #3580

Merged
merged 2 commits into from
Oct 14, 2020

Conversation

Simek
Copy link
Contributor

@Simek Simek commented Oct 13, 2020

Motivation

Currently Tabs are manually added by the users to the docs pages, but the customization (without introducing additional wrapper) is limited to the "block" and "non-block" appearance.

This simple PR adds the ability to pass className prop to Tabs, which if present, will be added at the end of class chain providing the users simple, unique CSS hook to customize the styling of selected Tabs block.

I have also added a small section about this feature to the docs on the Markdown Features page. It includes a brief description and an example usage (which required to add CSS to the custom.css file), here's the preview:

image

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

Docusuaurs V2 website running locally with the added in example on the Markdown Feature page.

Related PRs

N/A

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Oct 13, 2020
Co-authored-by: Alexey Pyltsyn <lex61rus@gmail.com>
@docusaurus-bot
Copy link
Contributor

docusaurus-bot commented Oct 13, 2020

Deploy preview for docusaurus-2 ready!

Built without sensitive environment variables with commit 16d6e91

https://deploy-preview-3580--docusaurus-2.netlify.app

Copy link
Contributor

@lex111 lex111 left a comment

Choose a reason for hiding this comment

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

LGTM

@slorber slorber added the pr: new feature This PR adds a new API or behavior. label Oct 14, 2020
@slorber
Copy link
Collaborator

slorber commented Oct 14, 2020

Thanks.

Wonder if it's worth to write as much doc for just passing a className prop.
I think we should forward className / style by default for all React elements that are advised to use in MDX.
But maybe this doc will be helpful for non-React users as we have a diverse user base so let's merge this.

@slorber slorber merged commit b85e6e0 into facebook:master Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: new feature This PR adds a new API or behavior.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants