diff --git a/README.md b/README.md index f9f2b7b..f3882fe 100644 --- a/README.md +++ b/README.md @@ -13,3 +13,11 @@ Astro. Please see the [`@apostrophecms/apostrophe-astro`](https://github.com/apostrophecms/apostrophe-astro) documentation for complete information about how to get started with this project. + +## Postcss plugin + +As you can see, there is a postcss config adding one plugin. +This is a needed plugin to make the apostrophe breakpoint preview working. +This is the feature that shows you how your site looks like on different device sizes, +if you don't need this feature you can remove the plugin. + diff --git a/package-lock.json b/package-lock.json index b2bde0f..9096d2f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,9 @@ "astro": "^4.0.0", "dayjs": "^1.11.10", "vite": "^5.0.7" + }, + "devDependencies": { + "postcss-viewport-to-container-toggle": "^1.0.0" } }, "node_modules/@ampproject/remapping": { @@ -4105,6 +4108,13 @@ "node": "^10 || ^12 || >=14" } }, + "node_modules/postcss-viewport-to-container-toggle": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/postcss-viewport-to-container-toggle/-/postcss-viewport-to-container-toggle-1.0.0.tgz", + "integrity": "sha512-ko7PrPXUw6S5E0iKJ2sRfPqwi7dDUXkbGr8OMP5ZJe3xzsT1Uv3waQxQ5trj0uKwoFqco4Tkr3g6CPlLYSwt5w==", + "dev": true, + "license": "MIT" + }, "node_modules/preferred-pm": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/preferred-pm/-/preferred-pm-4.0.0.tgz", diff --git a/package.json b/package.json index cd4816c..3f99c88 100644 --- a/package.json +++ b/package.json @@ -16,5 +16,8 @@ "astro": "^4.0.0", "dayjs": "^1.11.10", "vite": "^5.0.7" + }, + "devDependencies": { + "postcss-viewport-to-container-toggle": "^1.0.0" } } diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..d868e6d --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,13 @@ +import postcssViewportToContainerToggle from 'postcss-viewport-to-container-toggle'; + +export default { + // Is the site still editable in production like a normal Apos Site, + // if yes we need the plugin for all builds + plugins: [ + postcssViewportToContainerToggle({ + modifierAttr: 'data-breakpoint-preview-mode', + debug: false, + transform: null + }) + ] +}