-
I kind of feel the v2 docs are a little lacking in creating a custom theme... v1 uses What I'm doing is following the docs and using the Default theme as a reference, I created a copy of the default theme and moved it into my Error: This module was already loaded, so it can't be configured using "with".
┌──> node_modules/@picocss/pico/scss/pico.scss
1 │ @forward "settings";
│ ^^^^^^^^^^^^^^^^^^^ new load
╵
┌──> src/assets/styles/themes/autopilot/_styles.scss
4 │ @use "../../../../../node_modules/@picocss/pico/scss/settings" as *;
│ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ original load
╵
┌──> src/assets/styles/_config.scss
8 │ ┌ @use "pico" with (
9 │ │ $css-var-prefix: "--autopilot-",
10 │ │ $enable-semantic-container: true,
11 │ │ $enable-classes: true,
12 │ │ $modules: (
13 │ │ "themes/default": false,
14 │ │ )
15 │ │ );
│ └─^ configuration
╵
pico.scss 1:1
src/assets/styles/_config.scss 8:1 @use
src/assets/styles/themes/autopilot/_styles.scss 6:1 @use
src/assets/styles/themes/_autopilot.scss 2:1 @use
src/assets/styles/app.scss 23:2 root stylesheet And if I clear this out by removing the use of I've had to relative path to pico - even with the load Paths option set for Sass, but if I set But if anyone else has a solution on creating a custom theme with v2-rc please enlighten me on how you achieved this. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
|
Beta Was this translation helpful? Give feedback.
-
We had to move from I'm also learning here. I can see at least 2 cases: 1. Because picocss/picocss.com has 2. I'll do more testing to understand better how |
Beta Was this translation helpful? Give feedback.
-
For anybody consuming the package with NPM in 2025, make sure to import the project explicitly with
@use "@picocss/pico/scss/pico" with (
// * https://picocss.com/docs/sass
// Theme color: amber, azure, blue, cyan, fuchsia, green, grey, indigo, jade, lime, orange, pink, pumpkin, purple, red, sand, slate, violet, yellow, zinc
$theme-color: "orange",
// Enable <header>, <main>, <footer> inside $semantic-root-element as containers
$enable-semantic-container: false,
// Enable .classes
// .classless version if disabled
$enable-classes: true,
$modules: (
// Theme
"themes/default": true,
),
);
// custom theme
@use "../lib/styles/theme";
@forward "@picocss/pico/scss/pico"; // ADD THIS IN ALL FILES
// Styles
@use "theme/styles";
// Colors schemes
@use "theme/schemes";
@forward "@picocss/pico/scss/pico"; // ADD THIS IN ALL FILES
@use "sass:map";
@use "@picocss/pico/scss/colors" as *; // UPDATE THIS IN ALL FILES
@use "@picocss/pico/scss/settings" as *; // UPDATE THIS IN ALL FILES
@use "@picocss/pico/scss/helpers/functions"; // UPDATE THIS IN ALL FILES
@use "theme-colors";
// [...]
@forward "@picocss/pico/scss/pico"; // ADD THIS IN ALL FILES
// [...] |
Beta Was this translation helpful? Give feedback.
@sysmat
The v2 documentation is lacking and needs to be updated. @lucaslarroche
I had to re-read the Sass documentation on how to use
@use
and@forward
, but this is what I've done to get Pico working as a node_module with my custom theme.This is my
app.scss
:Then, in my custom theme,
themes/autopilot/_autopilot.scss
(which is just a copy of the Pico default theme), I update the imports: