I am using Nextra to write documentation for my ui library.
When I import my component in a .mdx file the theme styling of nextra is overriding my components original tailwind styling.
Nextra has a styles.css file in nextra-theme-docs which has a style for buttons
button,
[type=button],
[type=reset],
[type=submit] {
-webkit-appearance: button;
background-color: transparent;
background-image: none;
}
This makes my imported buttons from my component transparent.
Note: When I create a page named test.js in pages folder the buttons style are rendered properly.
Steps to reproduce:
- Install nextra and create a page called
button.mdxin pages folder and also create a_app.jsfile in pages folder - Install my library
npm i dashboard-components-library(it is still under development) - Install tailwind css following this guide
- Create a globals.css file in and add this tailwind css to it from this file and import this file in the _app.js file
- Now add this code to your
button.mdxfile
# Getting Started
For existing or new project add the dashboard-components-library using the NPM package manager.
import { Button } from "dashboard-components-library";
<Button text="Primary Button Type" buttonType="Primary"></Button>
- Run in dev mode