Skip to content

Commit

Permalink
Fix: Sass deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mphstudios authored Dec 11, 2024
1 parent fa8f173 commit 15cf1be
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 5 deletions.
13 changes: 12 additions & 1 deletion packages/11ty/_includes/components/lightbox/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,18 @@ module.exports = function (eleventyConfig) {
if (!fs.existsSync(lightboxStylesPath)) {
logger.warn(`q-lightbox component styles were not found at ${lightboxStylesPath}, this may cause the lightbox to behave unexpectedly.`)
} else {
lightboxCSS = sass.compile(lightboxStylesPath)
const sassOptions = {
api: 'modern-compiler',
loadPaths: [path.resolve('node_modules')],
silenceDeprecations: [
'color-functions',
'global-builtin',
'import',
'legacy-js-api',
'mixed-decls'
]
}
lightboxCSS = sass.compile(lightboxStylesPath, sassOptions)
}

return function () {
Expand Down
10 changes: 8 additions & 2 deletions packages/11ty/_plugins/transforms/outputs/epub/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,14 @@ module.exports = (eleventyConfig, collections) => {
* Copy styles
*/
const sassOptions = {
loadPaths: [
path.resolve('node_modules')
api: 'modern-compiler',
loadPaths: [path.resolve('node_modules')],
silenceDeprecations: [
'color-functions',
'global-builtin',
'import',
'legacy-js-api',
'mixed-decls'
]
}
const styles = sass.compile(path.resolve('content', assetsDir, 'styles', 'epub.scss'), sassOptions)
Expand Down
10 changes: 8 additions & 2 deletions packages/11ty/_plugins/transforms/outputs/pdf/write.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,14 @@ module.exports = (eleventyConfig) => {
}

const sassOptions = {
loadPaths: [
path.resolve('node_modules')
api: 'modern-compiler',
loadPaths: [path.resolve('node_modules')],
silenceDeprecations: [
'color-functions',
'global-builtin',
'import',
'legacy-js-api',
'mixed-decls'
]
}

Expand Down
19 changes: 19 additions & 0 deletions packages/11ty/_plugins/vite/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,25 @@ module.exports = function (eleventyConfig, { directoryConfig, publication }) {
},
sourcemap: true
},
/**
* Configure style pre-procssing
* @see https://vite.dev/config/shared-options#css-preprocessoroptions
* @see https://sass-lang.com/documentation/js-api/interfaces/options/
*/
css: {
preprocessorOptions: {
scss: {
api: 'modern-compiler',
silenceDeprecations: [
'color-functions',
'global-builtin',
'import',
'legacy-js-api',
'mixed-decls'
]
}
}
},
/**
* Set to false to prevent Vite from clearing the terminal screen
* and have Vite logging messages rendered alongside Eleventy output.
Expand Down

0 comments on commit 15cf1be

Please sign in to comment.