> Markdown version of [Flow CssImport Annotation](https://vaadin.com/docs/v24/styling/legacy/css-import). Section index: [llms.txt](https://vaadin.com/docs/v24/styling/llms.txt)

# Flow @CssImport Annotation

The `@CssImport` annotation was used in earlier versions of Vaadin Flow to load stylesheets into the application. It takes an optional `themeFor` parameter that can be used to inject CSS into the Shadow DOM of a Vaadin component by providing a string matching the component’s root element name.

```java
@CssImport("global-styles.css")
@CssImport(value = "text-field-styles.css", themeFor = "vaadin-text-field")
public class MyUI extends Div {
    …
}
```

Although this mechanism still works, the [application theme folder](https://vaadin.com/docs/v24/styling/application-theme.md) is now the recommended primary approach for loading application styles. It also supports [injection of Shadow DOM styles](https://vaadin.com/docs/v24/styling/advanced/shadow-dom-styling.md) into Vaadin components through the `components` sub-folder.

`@CssImport` is still a valid mechanism for loading stylesheets into [custom Flow-based components](https://vaadin.com/docs/v24/flow/create-ui/creating-components.md), in cases where these need to be separate from the application theme.
