Introduction
Use the @vtex/shoreline-cli for theme configuration.
Quick start
Install the Shoreline CLI
npm i @vtex/shoreline-cli @vtex/shoreline-themeThe @vtex/shoreline-theme is a peer dependency.
Create the shoreline.config.ts file
shoreline.config.ts
import { defineConfig } from '@vtex/shoreline-theme'
export default defineConfig({
preset: 'base',
})Your project's folder structure would become something similar to:
- index.ts
- [...files].extension
- shoreline.config.ts
- package.json
- tsconfig.json
Update package.json scripts
The prepare (opens in a new tab) script runs after every installation, or before any publish.
package.json
{
"scripts": {
+ "prepare": "shorelinecss theme",
}
}- styles.css
- types.d.ts
- shoreline.config.ts
- package.json
- tsconfig.json
Integrate the CSS on the application root
src/index.ts
import '../shoreline/styles.css'
export function App() {
return <div>Page</div>
}Update tsconfig.json (Optional)
tsconfig.json
{
// ...
"include": ["src", "shoreline"]
}Update gitignore (Optional)
Since we added the code generation in the prepare script, the /shoreline folder can be added to the .gitignore.
.gitignore
/shoreline