Stylization
DoksJS uses CSS Modules to style your applications. CSS Modules are a way to create reusable CSS styles that are scoped to your application. This makes it easy to keep your styles organized and avoid naming conflicts.
To style a DoksJS component, you need to create a CSS file that is named styles.module.css
and import it into your component. For example, the following code creates a CSS file that styles a button:
This CSS file defines a CSS class called .button
. The .button
class styles the button with a black background color, white text, and 10px of padding.
To import the CSS file into your component, you need to use the import
keyword. For example, the following code imports the styles.module.css
file into a component called Button
:
This code imports the styles.module.css
file and assigns the .button
CSS class to the button component.
You can also use the style
prop to style a DoksJS component. The style
prop is an object that can be used to set the CSS properties of the component. For example, the following code styles a button with the style
prop: