---
url: https://docs.youcan.shop/themes/best-practices/javascript-and-styles.md
---
# JavaScript and styles
## Where assets live
Stylesheets and scripts belong in the theme's `assets` directory and are referenced through the [`asset_url`](/themes/filters/assets/assetUrl) filter, which serves them from the CDN with a cache-busting version.
```bash
└── theme
├── assets
│ ├── main.css
│ ├── _global.js
│ ├── section.slideshow.css
│ ├── block.product.css
│ ...
...
```
The directory is flat, so mirror your `sections/` and `snippets/` names. A file called `section.slideshow.css` is obviously the stylesheet for `sections/slideshow.liquid`, and `block.product.css` for `snippets/block.product.liquid`.
## Loading assets
Pair `asset_url` with the tag filter that matches how the asset should load:
| Filter | Output |
| ------ | ------ |
| `stylesheet_tag` | A ``. |
| `script_tag` | A blocking `