There are a few ways you can write CSS in this project:
1. Use Tailwind css classes directly within layouts and components
This is often the fastest way to add custom styles if you are familair with Tailwind. See a good example in /src/p5/p5.js-website/src/components/Footer/index.astro
.
2. Write styles in the SCSS files in /styles
and use those classes in layouts and components
The styles folder is primarily meant for foundational styles that are used across pages and components. The majority of it is in /styles/global.scss
.
This can be useful for situations where the styling you need for a particular area is very complex and hard to distill in simple Tailwind classes. See a good example of this approach in /src/components/Dropdown
.
This can be a good approach when you need a few custom styles for a single a layout or component but adding an extra SCSS feels like overkill. See an example in /src/layouts/AboutLayout.astro
These global classes may do exactly what you need:
Both of these are useful for laying out a series of items in a responsive grid with the right spacing.
- .content-grid
- .content-grid-simple
Page layouts rely on having content within one or more <section>
's (or .section
's) to have proper spacing.
The .rendered-markdown
class is intended to wrap areas where we render markdown content from a content collection. See /src/layouts/TextDetailLayout.astro
for a simple example.