@@ -5,6 +5,7 @@ This directory contains the modular CSS architecture for the JSON-DOC renderer.
55## Architecture
66
77### File Structure
8+
89```
910styles/
1011├── index.css # Main entry point - imports all modules
@@ -23,64 +24,74 @@ styles/
2324## Usage
2425
2526### Default Import
27+
2628The renderer automatically imports the default styles:
29+
2730``` typescript
28- import { JsonDocRenderer } from ' @json-doc/typescript' ;
31+ import { JsonDocRenderer } from " @json-doc/typescript" ;
2932// Styles are automatically included
3033```
3134
3235### Custom Styling
36+
3337To customize styles, you can:
3438
35391 . ** Override CSS Variables** (recommended):
40+
3641``` css
3742:root {
3843 --jsondoc-text-primary : #2d3748 ;
39- --jsondoc-font-family-sans : ' Inter' , sans-serif ;
44+ --jsondoc-font-family-sans : " Inter" , sans-serif ;
4045 --jsondoc-spacing-lg : 20px ;
4146}
4247```
4348
44492 . ** Import Individual Modules** :
50+
4551``` css
46- @import ' @json-doc/typescript/dist/renderer/styles/variables.css' ;
47- @import ' @json-doc/typescript/dist/renderer/styles/base.css' ;
52+ @import " @json-doc/typescript/dist/renderer/styles/variables.css" ;
53+ @import " @json-doc/typescript/dist/renderer/styles/base.css" ;
4854/* Import only what you need */
4955```
5056
51573 . ** Create Your Own Theme** :
58+
5259``` css
5360/* my-theme.css */
54- @import ' @json-doc/typescript/dist/renderer/styles/variables.css' ;
61+ @import " @json-doc/typescript/dist/renderer/styles/variables.css" ;
5562
5663:root {
5764 /* Override variables */
5865 --jsondoc-text-primary : #1a202c ;
5966 --jsondoc-bg-code : #f7fafc ;
6067}
6168
62- @import ' @json-doc/typescript/dist/renderer/styles/base.css' ;
69+ @import " @json-doc/typescript/dist/renderer/styles/base.css" ;
6370/* Import other modules as needed */
6471```
6572
6673## CSS Variables (Design Tokens)
6774
6875### Colors
76+
6977- ` --jsondoc-text-primary ` : Primary text color
70- - ` --jsondoc-text-secondary ` : Secondary text color
78+ - ` --jsondoc-text-secondary ` : Secondary text color
7179- ` --jsondoc-text-muted ` : Muted text color
7280- ` --jsondoc-border-light ` : Light border color
7381- ` --jsondoc-border-medium ` : Medium border color
7482
7583### Background Colors
84+
7685- ` --jsondoc-bg-code ` : Code block background
7786- ` --jsondoc-bg-inline-code ` : Inline code background
7887- ` --jsondoc-bg-unsupported ` : Unsupported block background
7988
8089### Text Colors
90+
8191- ` --jsondoc-color-gray ` through ` --jsondoc-color-red ` : Notion-style text colors
8292
8393### Typography
94+
8495- ` --jsondoc-font-family-sans ` : Sans-serif font stack
8596- ` --jsondoc-font-family-mono ` : Monospace font stack
8697- ` --jsondoc-font-family-serif ` : Serif font stack
@@ -89,9 +100,11 @@ To customize styles, you can:
89100- ` --jsondoc-line-height-* ` : Line heights
90101
91102### Spacing
103+
92104- ` --jsondoc-spacing-xs ` through ` --jsondoc-spacing-3xl ` : Consistent spacing scale
93105
94106### Layout
107+
95108- ` --jsondoc-page-max-width ` : Maximum page width
96109- ` --jsondoc-page-padding-desktop ` : Desktop page padding
97110- ` --jsondoc-page-padding-mobile ` : Mobile page padding
@@ -100,7 +113,9 @@ To customize styles, you can:
100113## Theming
101114
102115### Light/Dark Mode
116+
103117The styles include automatic dark mode support:
118+
104119``` css
105120@media (prefers-color-scheme: dark) {
106121 :root {
@@ -111,7 +126,9 @@ The styles include automatic dark mode support:
111126```
112127
113128### Manual Theme Classes
129+
114130Force specific themes using classes:
131+
115132``` html
116133<div class =" jsondoc-theme-light" >
117134 <!-- Always light theme -->
@@ -123,7 +140,9 @@ Force specific themes using classes:
123140```
124141
125142### Custom Color Schemes
143+
126144Create your own color schemes:
145+
127146``` css
128147.my-custom-theme {
129148 --jsondoc-text-primary : #2b6cb0 ;
@@ -135,11 +154,13 @@ Create your own color schemes:
135154## Responsive Design
136155
137156The styles include responsive breakpoints:
157+
138158- Desktop: Default styles
139159- Tablet: ` max-width: 768px `
140160- Mobile: ` max-width: 480px `
141161
142162Override responsive behavior:
163+
143164``` css
144165@media (max-width : 768px ) {
145166 :root {
@@ -151,6 +172,7 @@ Override responsive behavior:
151172## Block-Specific Styling
152173
153174Each block type has its own CSS class namespace:
175+
154176- ` .notion-text-block ` : Paragraph blocks
155177- ` .notion-header-block ` : Heading 1 blocks
156178- ` .notion-sub_header-block ` : Heading 2/3 blocks
@@ -164,35 +186,38 @@ Each block type has its own CSS class namespace:
164186## Advanced Customization
165187
166188### Overriding Specific Components
189+
167190``` css
168191/* Custom code block styling */
169192.notion-code-block {
170193 background : var (--my-code-bg );
171194 border : 1px solid var (--my-code-border );
172- box-shadow : 0 2px 8px rgba (0 ,0 , 0 , 0.1 );
195+ box-shadow : 0 2px 8px rgba (0 , 0 , 0 , 0.1 );
173196}
174197```
175198
176199### Adding Custom Animations
200+
177201``` css
178202.notion-selectable {
179203 transition : all 0.2s ease ;
180204}
181205
182206.notion-selectable :hover {
183207 transform : translateY (-1px );
184- box-shadow : 0 4px 12px rgba (0 ,0 , 0 , 0.1 );
208+ box-shadow : 0 4px 12px rgba (0 , 0 , 0 , 0.1 );
185209}
186210```
187211
188212### Print Styles
213+
189214``` css
190215@media print {
191216 .json-doc-page {
192217 padding : 0 ;
193218 max-width : none ;
194219 }
195-
220+
196221 .notion-toggle-block {
197222 /* Expand all toggles for print */
198223 }
@@ -202,11 +227,13 @@ Each block type has its own CSS class namespace:
202227## Browser Compatibility
203228
204229The styles use modern CSS features:
230+
205231- CSS Custom Properties (CSS Variables)
206232- CSS Grid and Flexbox
207233- CSS Logical Properties
208234
209235Supports:
236+
210237- Chrome/Edge 49+
211238- Firefox 31+
212239- Safari 9.1+
@@ -223,9 +250,10 @@ For older browser support, consider using a CSS preprocessor to compile variable
223250## Contributing
224251
225252When adding new styles:
253+
2262541 . Add design tokens to ` variables.css ` first
2272552 . Use existing variables instead of hardcoded values
2282563 . Follow the modular structure
2292574 . Test responsive behavior
2302585 . Ensure dark mode compatibility
231- 6 . Update this README with new variables or classes
259+ 6 . Update this README with new variables or classes
0 commit comments