Skip to content

Commit 0bb1c4e

Browse files
Merge pull request #5 from matheusrocha89/doc-css
CSS
2 parents df71bc3 + 3064bbd commit 0bb1c4e

File tree

4 files changed

+25
-5
lines changed

4 files changed

+25
-5
lines changed

README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ https://github.com/user-attachments/assets/58c8cca5-878a-4e64-aa06-a8e202318f2a
2323
npm install @nobrainers/react-click-edit
2424
```
2525

26+
### CSS Import
27+
28+
The component requires its base CSS file to be imported. Add the following import to your application:
29+
30+
```tsx
31+
import "@nobrainers/react-click-edit/dist/style.css";
32+
```
33+
2634
## 🚀 Quick Start
2735

2836
```tsx
@@ -145,12 +153,23 @@ function ControlledExample() {
145153

146154
## 🎨 Styling
147155

148-
The component comes with minimal default styling and can be fully customized using CSS classes. All main elements accept custom class names through props.
156+
The component comes with minimal default styling through its base CSS file. You can override these styles or add additional styling using CSS classes. All main elements accept custom class names through props.
157+
158+
### Default Styling
159+
160+
Import the default styles in your application:
161+
162+
```tsx
163+
import "@nobrainers/react-click-edit/dist/style.css";
164+
```
165+
166+
### Custom Styling
149167

150168
Example with CSS modules:
151169

152170
```tsx
153-
import styles from "./styles.module.css";
171+
import "@nobrainers/react-click-edit/dist/style.css"; // Base styles
172+
import styles from "./styles.module.css"; // Your custom styles
154173

155174
<InputClickEdit
156175
className={styles.wrapper}

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
"name": "@nobrainers/react-click-edit",
33
"version": "1.2.0",
44
"description": "No Brainer input click to edit",
5-
"main": "index.js",
5+
"main": "dist/click-edit.umd.js",
6+
"module": "dist/click-edit.es.js",
7+
"types": "dist/index.d.ts",
68
"scripts": {
79
"build": "vite build",
810
"build:map": "vite build --sourcemap",

tsconfig.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
"lib": ["ESNext", "DOM"],
66
"jsx": "react-jsx",
77
"declaration": true,
8-
"declarationMap": true,
9-
"sourceMap": true,
108
"outDir": "dist",
119
"strict": true,
1210
"moduleResolution": "node",

vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export default defineConfig({
1111
}),
1212
dts({
1313
insertTypesEntry: true,
14+
exclude: ["**/*.test.tsx"],
1415
}),
1516
],
1617
css: {

0 commit comments

Comments
 (0)