diff --git a/docs/index.html b/docs/index.html index c2cf77cb..39ed415f 100644 --- a/docs/index.html +++ b/docs/index.html @@ -172,7 +172,8 @@
Example: pick a color!
+There are 2 ways to customize your version of Pico.css:
+It is recommended to customize Pico by importing SASS source files in your project. This way you can keep Pico up to date without conflicts since Pico code and your custom code are separated.
+Compile the SASS file to CSS to get a custom version of Pico.
-SCSS:
+/* Custom version */
-// Custom colors
+// Override default variables
$primary-500: ...;
$primary-600: ...;
$primary-700: ...;
-// Pico library
+// Import full Pico source code
@import "path/pico";
- CSS:
+ Alternatively, you can create a custom theme and import it in your project with the components you need.
+
+/* Custom version */
+
+// Custom theme
+@import "path/themes/custom";
+
+// Import needed components
+@import "path/layout/document";
+@import "path/layout/sectioning";
+...
+
+
+ This allows to create a lighter version with only the components that are useful to you. Example here: scss/pico.slim.scss.
+ Overriding CSS variables
+ All Pico's styles and colors are set with CSS custom properties (variables). Just override the CSS variables to customize your version of Pico.
/* Light scheme (Default) */
/* Can be forced with data-theme="light" */
[data-theme="light"],
:root:not([data-theme="dark"]) {
- --primary: ...;
- --primary-hover: ...;
- --primary-focus: ...;
- --primary-inverse: ...;
+ --primary: ...;
+ --primary-hover: ...;
+ --primary-focus: ...;
+ --primary-inverse: ...;
}
-
/* Dark scheme (Auto) */
/* Automatically enabled if user has Dark mode enabled */
@media only screen and (prefers-color-scheme: dark) {
- :root:not([data-theme="light"]) {
- --primary: ...;
- --primary-hover: ...;
- --primary-focus: ...;
- --primary-inverse: ...;
+ :root:not([data-theme="light"]) {
+ --primary: ...;
+ --primary-hover: ...;
+ --primary-focus: ...;
+ --primary-inverse: ...;
+ }
}
-
/* Dark scheme (Forced) */
/* Enabled if forced with data-theme="dark" */
-[data-theme="dark"] {
- --primary: ...;
- --primary-hover: ...;
- --primary-focus: ...;
- --primary-inverse: ...;
-}
+[data-theme="dark"] {
+ --primary: ...;
+ --primary-hover: ...;
+ --primary-focus: ...;
+ --primary-inverse: ...;
+}
- Colors can be modified in scss/themes/.
- Spacings, Typography, Rounded, Transitions, Breakpoints, etc. can be modified in scss/_variables.scss.
- You can also compile pico with only the modules you need to generate a slimer version. Example in scss/pico.slim.scss.
+/* (Common styles) */
+:root {
+ --primary-border: var(--primary) !important;
+ --primary-hover-border: var(--primary-hover) !important;
+ --input-hover-border: var(--primary-hover) !important;
+ --input-focus: var(--primary-focus) !important;
+ --input-inverse: var(--primary-inverse) !important;
+}
+
+
+ You can find all the CSS variables used in the default theme here: css/default.css
diff --git a/docs/js/pico.docs.min.js b/docs/js/pico.docs.min.js index 57384f24..a96740b4 100644 --- a/docs/js/pico.docs.min.js +++ b/docs/js/pico.docs.min.js @@ -1 +1 @@ -!function(){if(window.matchMedia("(min-width: 992px)").matches){var e=document.querySelector("aside nav"),t=document.querySelectorAll("aside details");if(e.clientHeight