Tailwind & SCSS
Gravity comes with two styling options included for you:
Tailwind
SCSS modules
By default, the components use Tailwind but you can use the SCSS version simply by changing the import statement in the component.
Using Tailwind
Import the output.css file into app/app.js
Using SCSS
Disable the import line above and enable the two SCSS imports in components/view/view
Using Custom Styles
You can feed a custom style to any component by passing it in the className
prop.
Live Reloading
Live reloading is automatically configured for Tailwind and SCSS. The start
script will watch for changes while the build
script adds the output CSS file to your static build folder.
Colors
Gravity includes a full-colour palette from the Tailwind library. There is also a brand colour configured inside the tailwind.config.js
file that you can modify with your brand colours.
Dark Mode
Dark mode is supported for both Tailwind and SCSS. It can be toggled on or off in the user dropdown nav on the top right corner (click the avatar to open it).
The setting is stored in both the authContext
on the client and in the user table of the database so it will persist across user sessions.
Further Help
If you're new to Tailwind and need more help, the Tailwind documentation provides a comprehensive guide to the principles along with a full reference guide to each utility class helper.
Last updated