I am new to Sage 10 and I am struggling to get Foundation 6.7.5 implemented and able to use the Foundation _settings.scss file in order to customise Foundation to my needs. I am hoping someone can help me as I would really like to be able to use Sage 10.
Here is my package.json file:
{
"name": "sage",
"private": true,
"browserslist": [
"extends @roots/browserslist-config"
],
"engines": {
"node": ">=16.0.0"
},
"type": "module",
"scripts": {
"dev": "bud dev",
"build": "bud build",
"translate": "yarn translate:pot && yarn translate:update",
"translate:pot": "wp i18n make-pot . ./resources/lang/sage.pot --include=\"app,resources\"",
"translate:update": "for filename in ./resources/lang/*.po; do msgmerge -U $filename ./resources/lang/sage.pot; done; rm -f ./resources/lang/*.po~",
"translate:compile": "yarn translate:mo && yarn translate:js",
"translate:js": "wp i18n make-json ./resources/lang --pretty-print",
"translate:mo": "wp i18n make-mo ./resources/lang ./resources/lang"
},
"devDependencies": {
"@popperjs/core": "^2.11.6",
"@roots/bud": "6.6.9",
"@roots/bud-sass": "^6.6.9",
"@roots/sage": "6.6.9",
"foundation-sites": "^6.7.5"
}
}
My bud.config.js file
/**
* Build configuration
*
* @see {@link https://roots.io/docs/sage/ sage documentation}
* @see {@link https://bud.js.org/guides/configure/ bud.js configuration guide}
*
* @typedef {import('@roots/bud').Bud} Bud
* @param {Bud} app
*/
export default async (app) => {
/**
* Application entrypoints
* @see {@link https://bud.js.org/docs/bud.entry/}
*/
app
.entry({
app: ['@scripts/app', '@styles/app', '@styles/foundation-settings'],
editor: ['@scripts/editor', '@styles/editor'],
})
/**
* Directory contents to be included in the compilation
* @see {@link https://bud.js.org/docs/bud.assets/}
*/
.assets(['images'])
/**
* Matched files trigger a page reload when modified
* @see {@link https://bud.js.org/docs/bud.watch/}
*/
.watch(['resources/views', 'app'])
/**
* Proxy origin (`WP_HOME`)
* @see {@link https://bud.js.org/docs/bud.proxy/}
*/
.proxy('http://site.test')
/**
* Development origin
* @see {@link https://bud.js.org/docs/bud.serve/}
*/
.serve('http://0.0.0.0:3000')
/**
* URI of the `public` directory
* @see {@link https://bud.js.org/docs/bud.setPublicPath/}
*/
.setPublicPath('/app/themes/sage/public/')
/**
* Generate WordPress `theme.json`
*
* @note This overwrites `theme.json` on every build.
*
* @see {@link https://bud.js.org/extensions/sage/theme.json/}
* @see {@link https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-json/}
*/
.wpjson.settings({
color: {
custom: false,
customDuotone: false,
customGradient: false,
defaultDuotone: false,
defaultGradients: false,
defaultPalette: false,
duotone: [],
},
custom: {
spacing: {},
typography: {
'font-size': {},
'line-height': {},
},
},
spacing: {
padding: true,
units: ['px', '%', 'em', 'rem', 'vw', 'vh'],
},
typography: {
customFontSize: false,
},
})
.enable();
};
I have tried importing the foundation.scss in my resources/styles/app.scss file:
@import '../../node_modules/foundation-sites/scss/foundation.scss';
and in resources/scripts/app.js I have:
import domReady from '@roots/sage/client/dom-ready';
import foundation from "foundation-sites";
/**
* Application entrypoint
*/
domReady(async () => {
// ...
});
/**
* @see {@link https://webpack.js.org/api/hot-module-replacement/}
*/
import.meta.webpackHot?.accept(console.error);
I have tried making changes to my resources/styles/foundation-settings.scss file (which is a copy of the /node_modules/foundation-sites/scss/settings/_settings.scss file but changes I make to that file have no effect on the rendered site.
Can anyone who has managed to get this working please give me a hand with getting this set up correctly?
Many thanks in advance.