From b2788a328bf463d4a640bc457453a7f5fc5d0fa5 Mon Sep 17 00:00:00 2001 From: uncenter <47499684+uncenter@users.noreply.github.com> Date: Tue, 17 Dec 2024 12:41:48 -0500 Subject: [PATCH] docs!: restructure documentation (#1445) --- .github/ISSUE_TEMPLATE/userstyle.yml | 2 +- .vscode/settings.json | 4 +- README.md | 65 +---- docs/CONTRIBUTING.md | 2 +- docs/FAQ.md | 7 + docs/SUMMARY.md | 32 +++ docs/USAGE.md | 33 +++ docs/guide/README.md | 7 + docs/guide/images-and-svgs.md | 106 ++++++++ docs/guide/rgb-values.md | 9 + docs/guide/syntax-highlighting.md | 70 ++++++ docs/tips-and-tricks.md | 227 ------------------ docs/tips-and-tricks/README.md | 6 + .../tips-and-tricks/convert-images-to-webp.md | 20 ++ ...ide-sensitive-information-from-previews.md | 15 ++ .../inspect-hard-to-grab-elements.md | 11 + .../see-changes-in-real-time.md | 1 + docs/tutorials/README.md | 3 + .../writing-a-userstyle.md} | 36 +-- docs/userstyle-creation.md | 42 +--- docs/userstylesyml.md | 33 +-- .../generate/templates/userstyle-issue.yml | 2 +- 22 files changed, 361 insertions(+), 372 deletions(-) create mode 100644 docs/FAQ.md create mode 100644 docs/SUMMARY.md create mode 100644 docs/USAGE.md create mode 100644 docs/guide/README.md create mode 100644 docs/guide/images-and-svgs.md create mode 100644 docs/guide/rgb-values.md create mode 100644 docs/guide/syntax-highlighting.md delete mode 100644 docs/tips-and-tricks.md create mode 100644 docs/tips-and-tricks/README.md create mode 100644 docs/tips-and-tricks/convert-images-to-webp.md create mode 100644 docs/tips-and-tricks/hide-sensitive-information-from-previews.md create mode 100644 docs/tips-and-tricks/inspect-hard-to-grab-elements.md create mode 100644 docs/tips-and-tricks/see-changes-in-real-time.md create mode 100644 docs/tutorials/README.md rename docs/{how-to-write-a-userstyle.md => tutorials/writing-a-userstyle.md} (93%) diff --git a/.github/ISSUE_TEMPLATE/userstyle.yml b/.github/ISSUE_TEMPLATE/userstyle.yml index ee9342d2..c700dea4 100644 --- a/.github/ISSUE_TEMPLATE/userstyle.yml +++ b/.github/ISSUE_TEMPLATE/userstyle.yml @@ -33,7 +33,7 @@ body: - type: input attributes: label: What browser(s) are you seeing the problem on? - description: "The browser version is also important, you can find out how to get that info [here](https://github.com/catppuccin/userstyles/blob/main/docs/browsers.md)." + description: "Make sure to include the browser version - see https://github.com/catppuccin/userstyles/blob/main/docs/browsers.md for instructions." placeholder: Firefox v112.0.2 validations: required: true diff --git a/.vscode/settings.json b/.vscode/settings.json index 44b40b87..c3343cf7 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -10,5 +10,7 @@ }, "[typescript][javascript]": { "editor.defaultFormatter": "denoland.vscode-deno" - } + }, + + "markdown.extension.toc.updateOnSave": false } diff --git a/README.md b/README.md index 8215dd75..0506755c 100644 --- a/README.md +++ b/README.md @@ -5,14 +5,6 @@ -
- Install - ยท - Contributing - ยท - Userstyles -
-

@@ -25,61 +17,14 @@

-This repository is a curated collection of customized themes designed for various websites and web applications. -These themes showcase delightful pastel colors, creating a soothing and visually pleasing experience when browsing the web. +A curated collection of customized themes designed for various websites and web applications. These themes showcase delightful pastel colors, creating a soothing and visually pleasing experience when browsing the web.

-

-Userstyles are essentially modified CSS files which can be applied to a specific website, -giving it a unique and appealing aesthetic in line with Catppuccin's color palette. -

+## Getting started -  +To get started using the catppuccin/userstyles collection, see [Usage](docs/USAGE.md). -## Usage - -For both of the below installation methods, you will need the Stylus browser extension installed. Install [Stylus](https://github.com/openstyles/stylus) for [Chrome](https://chromewebstore.google.com/detail/stylus/clngdbkpkpeebahjckkjfobafhncgmne) or [Firefox](https://addons.mozilla.org/en-GB/firefox/addon/styl-us/). If you use Chrome, make sure to enable "Allow access to file URLs" in the Chrome extension settings for Stylus (visit `chrome://extensions/?id=clngdbkpkpeebahjckkjfobafhncgmne`). - -> [!TIP] -> If you use [Dark Reader](https://darkreader.org/), make sure to disable the extension on websites with Catppuccin userstyles installed to avoid conflicts. - -### All Userstyles - -1. Download the compiled Stylus export file, containing our recommended Stylus settings and all userstyles preloaded: [`import.json` (download)](https://github.com/catppuccin/userstyles/releases/download/all-userstyles-export/import.json). - - Alternatively, if you want more control over what is included in the `import.json` file, e.g. all userstyles with the accent color `peach`, you can download the Stylus export file from "[All Userstyles Import Generator](https://ctp-aui.uncenter.dev/)" by [@uncenter](https://github.com/uncenter) instead. -2. Open the Stylus "manage" page. -3. On the sidebar panel, click the **Import** button in the **Backup** section, and select the downloaded file from step 2. -4. Enjoy! - -### Individual Userstyles - -1. Enable CSP Patching from Stylus's **Settings** > **Advanced**. -2. Install userstyles from the list below by clicking the **Stylus Install** badge in each README. -3. Enjoy! - -## Configuration - -All usertyles come with three default configuration options; the light flavor, the dark flavor, and the accent color. Some userstyles may offer additional site-specific options as well. - -### Decentralized/self-hosted applications - -For decentralized or self-hosted applications, you can apply a theme to one or multiple instances across updates by following the instructions below. - -1. Open the Stylus "Manage" page. -2. Click on the userstyle's name in the list. -3. Click on **Style settings** in the left panel. -4. Enter the URL patterns for your instance(s) in the text box labeled **Custom included sites**. For example, to apply a userstyle to `example.org`, you would add a line with `https://example.org/*` to the textbox. The trailing asterisk applies it to all pages on the domain - without it, only the root page is themed. - -  - -## ๐Ÿ‘ Contributing - -> [!NOTE] -> If you would like to submit a userstyle or learn how to port Catppuccin to a website, please refer to [userstyle-creation.md](docs/userstyle-creation.md). - -See [CONTRIBUTING.md](docs/CONTRIBUTING.md). - -  +To get started contributing to catppuccin/userstyles, see [Contributing](docs/CONTRIBUTING.md) and [Userstyle Creation](docs/userstyle-creation.md). ## ๐Ÿ–Œ Userstyles @@ -87,7 +32,7 @@ See [CONTRIBUTING.md](docs/CONTRIBUTING.md). > Userstyles labeled with the "๐Ÿšง" emoji are looking for maintainers, and may > not work as intended. Contributions are still welcome and encouraged. If you > would like to become a maintainer, follow the instructions outlined in -> "[Adding yourself as a maintainer](https://github.com/catppuccin/userstyles/blob/main/docs/userstylesyml.md#adding-yourself-as-a-maintainer)." +> "[Adding yourself as a maintainer](docs/userstylesyml.md#adding-yourself-as-a-maintainer)." diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index e86a7361..e2f80c9b 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -15,7 +15,7 @@ request. This repositories uses [Deno](https://deno.com/) extensively for linting and automation. We recommend setting up Deno locally to improve your workflow โ€” see ["Installation" - Deno Docs](https://docs.deno.com/runtime/manual/getting_started/installation). With Deno installed locally, you can run the lint script using `deno task lint` (and `deno task lint:fix` to automatically apply fixes) and the formatting script using `deno task format`. -When editing a userstyle, we suggest setting up live reloading so your local changes can be automatically reloaded through Stylus. See ["How can I see my changes in real time?"](./tips-and-tricks.md#how-can-i-see-my-changes-in-real-time). +When editing a userstyle, we suggest setting up live reloading so your local changes can be automatically reloaded through Stylus. See ["How can I see my changes in real time?"](./tips-and-tricks/see-changes-in-real-time.md). ## Recommendations diff --git a/docs/FAQ.md b/docs/FAQ.md new file mode 100644 index 00000000..b20f900c --- /dev/null +++ b/docs/FAQ.md @@ -0,0 +1,7 @@ +## This userstyle is broken! + +Sorry to hear that! Please [open an issue](https://github.com/catppuccin/userstyles/issues/new?template=userstyle.yml). + +## Can I request a userstyle? + +To request a website to be themed, please create a [Port Request](https://github.com/catppuccin/catppuccin/discussions/new?category=port-requests) discussion on [catppuccin/catppuccin](https://github.com/catppuccin/catppuccin). While this may seem odd, this ensures to keep all of our requests in one place and makes it easier for all people to request what they want without needing to learn what "Stylus" exactly is. diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md new file mode 100644 index 00000000..eb63bb83 --- /dev/null +++ b/docs/SUMMARY.md @@ -0,0 +1,32 @@ +# Summary + +- [Introduction](./README.md) + +- [Usage](./USAGE.md) + +- [FAQ](./FAQ.md) + +--- + +- [Contributing](./CONTRIBUTING.md) + +- [Userstyle Creation](./userstyle-creation.md) + + - [Guide](./guide/README.md) + + - [Images and SVGs](./guide/images-and-svgs.md) + - [Syntax highlighting](./guide/syntax-highlighting.md) + - [Extracting RGB values](./guide/rgb-values.md) + + - [Tutorials](./tutorials/README.md) + + - [Writing a userstyle (walkthrough)](./tutorials/writing-a-userstyle.md) + + - [Tips and Tricks](./tips-and-tricks/README.md) + + - [Convert images to WebP](./tips-and-tricks/convert-images-to-webp.md) + - [Hide sensitive information from preview screenshots](./tips-and-tricks/hide-sensitive-information-from-previews.md) + - [Inspect hard-to-grab elements](./tips-and-tricks/inspect-hard-to-grab-elements.md) + - [See changes in real time (hot reloading)](./tips-and-tricks/see-changes-in-real-time.md) + +- [`userstyles.yml`](./userstylesyml.md) diff --git a/docs/USAGE.md b/docs/USAGE.md new file mode 100644 index 00000000..4f60122f --- /dev/null +++ b/docs/USAGE.md @@ -0,0 +1,33 @@ +# Usage + +For both of the below installation methods, you will need the Stylus browser extension installed. Install [Stylus](https://github.com/openstyles/stylus) for [Chrome](https://chromewebstore.google.com/detail/stylus/clngdbkpkpeebahjckkjfobafhncgmne) or [Firefox](https://addons.mozilla.org/en-GB/firefox/addon/styl-us/). If you use Chrome, make sure to enable "Allow access to file URLs" in the Chrome extension settings for Stylus (visit `chrome://extensions/?id=clngdbkpkpeebahjckkjfobafhncgmne`). + +> [!TIP] +> If you use [Dark Reader](https://darkreader.org/), make sure to disable the extension on websites with Catppuccin userstyles installed to avoid conflicts. + +## All Userstyles + +1. Download the compiled Stylus export file, containing our recommended Stylus settings and all userstyles preloaded: [`import.json` (download)](https://github.com/catppuccin/userstyles/releases/download/all-userstyles-export/import.json). + - Alternatively, if you want more control over what is included in the `import.json` file, e.g. all userstyles with the accent color `peach`, you can download the Stylus export file from "[All Userstyles Import Generator](https://ctp-aui.uncenter.dev/)" by [@uncenter](https://github.com/uncenter) instead. +2. Open the Stylus "manage" page. +3. On the sidebar panel, click the **Import** button in the **Backup** section, and select the downloaded file from step 2. +4. Enjoy! + +## Individual Userstyles + +1. Enable CSP Patching from Stylus's **Settings** > **Advanced**. +2. Install userstyles from the list below by clicking the **Stylus Install** badge in each README. +3. Enjoy! + +# Configuration + +All usertyles come with three default configuration options; the light flavor, the dark flavor, and the accent color. Some userstyles may offer additional site-specific options as well. + +## Decentralized/self-hosted applications + +For decentralized or self-hosted applications, you can apply a theme to one or multiple instances across updates by following the instructions below. + +1. Open the Stylus "Manage" page. +2. Click on the userstyle's name in the list. +3. Click on **Style settings** in the left panel. +4. Enter the URL patterns for your instance(s) in the text box labeled **Custom included sites**. For example, to apply a userstyle to `example.org`, you would add a line with `https://example.org/*` to the textbox. The trailing asterisk applies it to all pages on the domain - without it, only the root page is themed. diff --git a/docs/guide/README.md b/docs/guide/README.md new file mode 100644 index 00000000..509e4987 --- /dev/null +++ b/docs/guide/README.md @@ -0,0 +1,7 @@ +# Guide + +> _How can I theme ...?_ + +- [Images and SVGs](./images-and-svgs.md) +- [Syntax highlighting](./syntax-highlighting.md) +- [Extracting RGB values](./rgb-values.md) diff --git a/docs/guide/images-and-svgs.md b/docs/guide/images-and-svgs.md new file mode 100644 index 00000000..3293c90e --- /dev/null +++ b/docs/guide/images-and-svgs.md @@ -0,0 +1,106 @@ +## SVGs as `background-image`s + +Websites will sometimes use the `background-image` CSS property to apply an SVG, often for icons. We will refer to these as "external SVGs" throughout the rest of this guide, as the SVGs are usually at a different URL and linked to with [`url()`](https://developer.mozilla.org/en-US/docs/Web/CSS/url). Below is an example of what a rule for an external SVG could look like. + +```css +.xyz { + background-image: url("https://example.org/assets/xyz.svg"); +} +``` + +The easiest way to theme external SVGs is to visit the URL of the SVG and paste its contents in between the single quotes of the `escape('')` section of the following template: + +```less +.xyz { + @svg: escape("..."); + background-image: url("data:image/svg+xml,@{svg}"); +} +``` + +> [!NOTE] +> The `Invalid % without number` error may appear if you have not done the following step. Make sure to add/replace an interpolated color in the SVG contents (as is detailed below) for this error to go away. + +Now, replace any colors in the SVG with their respective Catppuccin variants. For example, take the following SVG icon for Twitter: + +```xml + +``` + +There is only one color used, `fill="#1D9BF0"`. That hex code is a shade of blue, so we can replace it with the `@blue` color using the `fill="@{}"` syntax ([variable interpolation](https://lesscss.org/features/#variables-feature-variable-interpolation)). + +```less +.twitter-icon { + @svg: escape( + '' + ); + background-image: url("data:image/svg+xml,@{svg}"); +} +``` + +## `` elements + +Theming an inline image is similar, but `content` is used instead of `background-image` to cover up the original image with our new one. As with the previous tip for `background-image`, you only need to update the SVG inside of the `escape('')` (see above for details). + +```less +img.xyz { + @svg: escape("..."); + content: url("data:image/svg+xml,@{svg}"); +} +``` + +Again, following the example of theming a Twitter logo: + +```less +img.twitter-icon { + @svg: escape( + '' + ); + content: url("data:image/svg+xml,@{svg}"); +} +``` + +## Non-SVG images or many `` elements with external SVGs + +If you encounter non-SVG images, or many `` elements with external SVGs, the best approach is to apply a CSS color filter to the images. Start by adding the following specially generated filters palette block to the bottom of the userstyle, below the existing `@catppuccin` palette block. + +```css +/* prettier-ignore */ +@catppuccin-filters: { + @latte: { @rosewater: brightness(0) saturate(100%) invert(65%) sepia(18%) saturate(1048%) hue-rotate(323deg) brightness(92%) contrast(86%); @flamingo: brightness(0) saturate(100%) invert(84%) sepia(44%) saturate(4533%) hue-rotate(310deg) brightness(98%) contrast(75%); @pink: brightness(0) saturate(100%) invert(60%) sepia(32%) saturate(775%) hue-rotate(266deg) brightness(93%) contrast(97%); @mauve: brightness(0) saturate(100%) invert(26%) sepia(59%) saturate(3315%) hue-rotate(255deg) brightness(94%) contrast(100%); @red: brightness(0) saturate(100%) invert(16%) sepia(78%) saturate(7275%) hue-rotate(342deg) brightness(84%) contrast(94%); @maroon: brightness(0) saturate(100%) invert(31%) sepia(56%) saturate(2395%) hue-rotate(331deg) brightness(99%) contrast(82%); @peach: brightness(0) saturate(100%) invert(38%) sepia(81%) saturate(1292%) hue-rotate(356deg) brightness(103%) contrast(99%); @yellow: brightness(0) saturate(100%) invert(74%) sepia(47%) saturate(4570%) hue-rotate(354deg) brightness(95%) contrast(83%); @green: brightness(0) saturate(100%) invert(51%) sepia(25%) saturate(4134%) hue-rotate(76deg) brightness(95%) contrast(66%); @teal: brightness(0) saturate(100%) invert(41%) sepia(45%) saturate(1101%) hue-rotate(139deg) brightness(100%) contrast(82%); @sky: brightness(0) saturate(100%) invert(47%) sepia(76%) saturate(2427%) hue-rotate(166deg) brightness(99%) contrast(97%); @sapphire: brightness(0) saturate(100%) invert(52%) sepia(41%) saturate(6982%) hue-rotate(160deg) brightness(102%) contrast(75%); @blue: brightness(0) saturate(100%) invert(30%) sepia(80%) saturate(1850%) hue-rotate(209deg) brightness(94%) contrast(105%); @lavender: brightness(0) saturate(100%) invert(48%) sepia(61%) saturate(538%) hue-rotate(194deg) brightness(102%) contrast(98%); @text: brightness(0) saturate(100%) invert(30%) sepia(10%) saturate(1259%) hue-rotate(196deg) brightness(97%) contrast(91%); @subtext1: brightness(0) saturate(100%) invert(36%) sepia(10%) saturate(890%) hue-rotate(196deg) brightness(98%) contrast(90%); @subtext0: brightness(0) saturate(100%) invert(47%) sepia(6%) saturate(1263%) hue-rotate(195deg) brightness(90%) contrast(81%); @overlay2: brightness(0) saturate(100%) invert(59%) sepia(7%) saturate(825%) hue-rotate(195deg) brightness(83%) contrast(91%); @overlay1: brightness(0) saturate(100%) invert(59%) sepia(14%) saturate(333%) hue-rotate(194deg) brightness(95%) contrast(89%); @overlay0: brightness(0) saturate(100%) invert(85%) sepia(7%) saturate(595%) hue-rotate(191deg) brightness(77%) contrast(81%); @surface2: brightness(0) saturate(100%) invert(86%) sepia(6%) saturate(482%) hue-rotate(189deg) brightness(82%) contrast(88%); @surface1: brightness(0) saturate(100%) invert(85%) sepia(8%) saturate(281%) hue-rotate(187deg) brightness(92%) contrast(88%); @surface0: brightness(0) saturate(100%) invert(96%) sepia(1%) saturate(5123%) hue-rotate(185deg) brightness(93%) contrast(83%); @base: brightness(0) saturate(100%) invert(89%) sepia(5%) saturate(140%) hue-rotate(182deg) brightness(109%) contrast(94%); @mantle: brightness(0) saturate(100%) invert(93%) sepia(19%) saturate(55%) hue-rotate(182deg) brightness(98%) contrast(92%); @crust: brightness(0) saturate(100%) invert(91%) sepia(1%) saturate(4489%) hue-rotate(196deg) brightness(106%) contrast(82%); }; + @frappe: { @rosewater: brightness(0) saturate(100%) invert(90%) sepia(6%) saturate(734%) hue-rotate(321deg) brightness(95%) contrast(99%); @flamingo: brightness(0) saturate(100%) invert(88%) sepia(52%) saturate(817%) hue-rotate(293deg) brightness(113%) contrast(84%); @pink: brightness(0) saturate(100%) invert(76%) sepia(15%) saturate(844%) hue-rotate(280deg) brightness(107%) contrast(91%); @mauve: brightness(0) saturate(100%) invert(71%) sepia(25%) saturate(725%) hue-rotate(225deg) brightness(94%) contrast(91%); @red: brightness(0) saturate(100%) invert(67%) sepia(3%) saturate(7209%) hue-rotate(305deg) brightness(91%) contrast(99%); @maroon: brightness(0) saturate(100%) invert(61%) sepia(14%) saturate(957%) hue-rotate(307deg) brightness(109%) contrast(90%); @peach: brightness(0) saturate(100%) invert(68%) sepia(28%) saturate(662%) hue-rotate(335deg) brightness(96%) contrast(94%); @yellow: brightness(0) saturate(100%) invert(94%) sepia(88%) saturate(684%) hue-rotate(309deg) brightness(105%) contrast(80%); @green: brightness(0) saturate(100%) invert(89%) sepia(23%) saturate(582%) hue-rotate(42deg) brightness(87%) contrast(89%); @teal: brightness(0) saturate(100%) invert(91%) sepia(13%) saturate(986%) hue-rotate(110deg) brightness(85%) contrast(81%); @sky: brightness(0) saturate(100%) invert(75%) sepia(15%) saturate(623%) hue-rotate(141deg) brightness(109%) contrast(81%); @sapphire: brightness(0) saturate(100%) invert(77%) sepia(20%) saturate(730%) hue-rotate(157deg) brightness(97%) contrast(76%); @blue: brightness(0) saturate(100%) invert(68%) sepia(16%) saturate(1070%) hue-rotate(185deg) brightness(96%) contrast(95%); @lavender: brightness(0) saturate(100%) invert(75%) sepia(20%) saturate(626%) hue-rotate(201deg) brightness(101%) contrast(89%); @text: brightness(0) saturate(100%) invert(83%) sepia(12%) saturate(582%) hue-rotate(191deg) brightness(98%) contrast(96%); @subtext1: brightness(0) saturate(100%) invert(80%) sepia(18%) saturate(411%) hue-rotate(190deg) brightness(96%) contrast(84%); @subtext0: brightness(0) saturate(100%) invert(82%) sepia(6%) saturate(1287%) hue-rotate(192deg) brightness(86%) contrast(85%); @overlay2: brightness(0) saturate(100%) invert(65%) sepia(36%) saturate(230%) hue-rotate(190deg) brightness(92%) contrast(82%); @overlay1: brightness(0) saturate(100%) invert(55%) sepia(12%) saturate(638%) hue-rotate(189deg) brightness(98%) contrast(87%); @overlay0: brightness(0) saturate(100%) invert(49%) sepia(13%) saturate(662%) hue-rotate(192deg) brightness(94%) contrast(84%); @surface2: brightness(0) saturate(100%) invert(41%) sepia(20%) saturate(469%) hue-rotate(191deg) brightness(93%) contrast(86%); @surface1: brightness(0) saturate(100%) invert(34%) sepia(14%) saturate(771%) hue-rotate(190deg) brightness(89%) contrast(85%); @surface0: brightness(0) saturate(100%) invert(28%) sepia(7%) saturate(1468%) hue-rotate(193deg) brightness(92%) contrast(95%); @base: brightness(0) saturate(100%) invert(20%) sepia(17%) saturate(747%) hue-rotate(192deg) brightness(96%) contrast(97%); @mantle: brightness(0) saturate(100%) invert(8%) sepia(7%) saturate(7271%) hue-rotate(198deg) brightness(88%) contrast(75%); @crust: brightness(0) saturate(100%) invert(7%) sepia(7%) saturate(7415%) hue-rotate(197deg) brightness(86%) contrast(79%); }; + @macchiato: { @rosewater: brightness(0) saturate(100%) invert(88%) sepia(13%) saturate(322%) hue-rotate(321deg) brightness(102%) contrast(91%); @flamingo: brightness(0) saturate(100%) invert(82%) sepia(3%) saturate(3070%) hue-rotate(314deg) brightness(107%) contrast(88%); @pink: brightness(0) saturate(100%) invert(80%) sepia(23%) saturate(509%) hue-rotate(280deg) brightness(102%) contrast(92%); @mauve: brightness(0) saturate(100%) invert(65%) sepia(18%) saturate(903%) hue-rotate(222deg) brightness(104%) contrast(93%); @red: brightness(0) saturate(100%) invert(61%) sepia(19%) saturate(1541%) hue-rotate(305deg) brightness(110%) contrast(86%); @maroon: brightness(0) saturate(100%) invert(71%) sepia(10%) saturate(1331%) hue-rotate(306deg) brightness(93%) contrast(101%); @peach: brightness(0) saturate(100%) invert(73%) sepia(13%) saturate(1676%) hue-rotate(330deg) brightness(103%) contrast(92%); @yellow: brightness(0) saturate(100%) invert(87%) sepia(89%) saturate(321%) hue-rotate(314deg) brightness(101%) contrast(87%); @green: brightness(0) saturate(100%) invert(93%) sepia(12%) saturate(1128%) hue-rotate(48deg) brightness(92%) contrast(85%); @teal: brightness(0) saturate(100%) invert(92%) sepia(10%) saturate(1176%) hue-rotate(110deg) brightness(87%) contrast(90%); @sky: brightness(0) saturate(100%) invert(78%) sepia(57%) saturate(230%) hue-rotate(142deg) brightness(96%) contrast(84%); @sapphire: brightness(0) saturate(100%) invert(74%) sepia(35%) saturate(438%) hue-rotate(156deg) brightness(92%) contrast(93%); @blue: brightness(0) saturate(100%) invert(67%) sepia(17%) saturate(1007%) hue-rotate(183deg) brightness(99%) contrast(94%); @lavender: brightness(0) saturate(100%) invert(74%) sepia(6%) saturate(2559%) hue-rotate(198deg) brightness(103%) contrast(94%); @text: brightness(0) saturate(100%) invert(81%) sepia(9%) saturate(726%) hue-rotate(192deg) brightness(104%) contrast(92%); @subtext1: brightness(0) saturate(100%) invert(84%) sepia(5%) saturate(1453%) hue-rotate(193deg) brightness(94%) contrast(86%); @subtext0: brightness(0) saturate(100%) invert(75%) sepia(18%) saturate(361%) hue-rotate(190deg) brightness(91%) contrast(86%); @overlay2: brightness(0) saturate(100%) invert(67%) sepia(9%) saturate(814%) hue-rotate(191deg) brightness(92%) contrast(88%); @overlay1: brightness(0) saturate(100%) invert(49%) sepia(38%) saturate(203%) hue-rotate(190deg) brightness(101%) contrast(93%); @overlay0: brightness(0) saturate(100%) invert(46%) sepia(16%) saturate(552%) hue-rotate(193deg) brightness(93%) contrast(84%); @surface2: brightness(0) saturate(100%) invert(34%) sepia(16%) saturate(611%) hue-rotate(192deg) brightness(101%) contrast(87%); @surface1: brightness(0) saturate(100%) invert(30%) sepia(11%) saturate(1085%) hue-rotate(194deg) brightness(92%) contrast(89%); @surface0: brightness(0) saturate(100%) invert(18%) sepia(21%) saturate(880%) hue-rotate(193deg) brightness(97%) contrast(84%); @base: brightness(0) saturate(100%) invert(12%) sepia(42%) saturate(570%) hue-rotate(194deg) brightness(90%) contrast(90%); @mantle: brightness(0) saturate(100%) invert(6%) sepia(6%) saturate(7499%) hue-rotate(200deg) brightness(93%) contrast(85%); @crust: brightness(0) saturate(100%) invert(5%) sepia(8%) saturate(5346%) hue-rotate(202deg) brightness(98%) contrast(88%); }; + @mocha: { @rosewater: brightness(0) saturate(100%) invert(92%) sepia(5%) saturate(704%) hue-rotate(320deg) brightness(99%) contrast(93%); @flamingo: brightness(0) saturate(100%) invert(81%) sepia(5%) saturate(987%) hue-rotate(315deg) brightness(107%) contrast(90%); @pink: brightness(0) saturate(100%) invert(86%) sepia(11%) saturate(1177%) hue-rotate(283deg) brightness(101%) contrast(92%); @mauve: brightness(0) saturate(100%) invert(65%) sepia(58%) saturate(255%) hue-rotate(224deg) brightness(96%) contrast(102%); @red: brightness(0) saturate(100%) invert(61%) sepia(19%) saturate(997%) hue-rotate(294deg) brightness(104%) contrast(91%); @maroon: brightness(0) saturate(100%) invert(66%) sepia(16%) saturate(1301%) hue-rotate(306deg) brightness(116%) contrast(84%); @peach: brightness(0) saturate(100%) invert(68%) sepia(57%) saturate(278%) hue-rotate(338deg) brightness(98%) contrast(101%); @yellow: brightness(0) saturate(100%) invert(90%) sepia(70%) saturate(380%) hue-rotate(313deg) brightness(102%) contrast(95%); @green: brightness(0) saturate(100%) invert(88%) sepia(6%) saturate(2015%) hue-rotate(63deg) brightness(104%) contrast(78%); @teal: brightness(0) saturate(100%) invert(92%) sepia(12%) saturate(991%) hue-rotate(108deg) brightness(93%) contrast(90%); @sky: brightness(0) saturate(100%) invert(84%) sepia(21%) saturate(1302%) hue-rotate(164deg) brightness(106%) contrast(84%); @sapphire: brightness(0) saturate(100%) invert(74%) sepia(20%) saturate(876%) hue-rotate(156deg) brightness(96%) contrast(93%); @blue: brightness(0) saturate(100%) invert(68%) sepia(18%) saturate(951%) hue-rotate(180deg) brightness(98%) contrast(100%); @lavender: brightness(0) saturate(100%) invert(73%) sepia(7%) saturate(1670%) hue-rotate(195deg) brightness(102%) contrast(99%); @text: brightness(0) saturate(100%) invert(86%) sepia(6%) saturate(879%) hue-rotate(190deg) brightness(100%) contrast(93%); @subtext1: brightness(0) saturate(100%) invert(84%) sepia(19%) saturate(381%) hue-rotate(193deg) brightness(91%) contrast(89%); @subtext0: brightness(0) saturate(100%) invert(84%) sepia(9%) saturate(767%) hue-rotate(192deg) brightness(84%) contrast(84%); @overlay2: brightness(0) saturate(100%) invert(63%) sepia(15%) saturate(428%) hue-rotate(191deg) brightness(96%) contrast(84%); @overlay1: brightness(0) saturate(100%) invert(56%) sepia(15%) saturate(455%) hue-rotate(192deg) brightness(90%) contrast(88%); @overlay0: brightness(0) saturate(100%) invert(44%) sepia(6%) saturate(1275%) hue-rotate(194deg) brightness(97%) contrast(88%); @surface2: brightness(0) saturate(100%) invert(34%) sepia(8%) saturate(1015%) hue-rotate(195deg) brightness(99%) contrast(89%); @surface1: brightness(0) saturate(100%) invert(25%) sepia(6%) saturate(1950%) hue-rotate(197deg) brightness(99%) contrast(86%); @surface0: brightness(0) saturate(100%) invert(19%) sepia(5%) saturate(2844%) hue-rotate(199deg) brightness(91%) contrast(93%); @base: brightness(0) saturate(100%) invert(7%) sepia(4%) saturate(7496%) hue-rotate(202deg) brightness(93%) contrast(87%); @mantle: brightness(0) saturate(100%) invert(6%) sepia(4%) saturate(7465%) hue-rotate(202deg) brightness(95%) contrast(90%); @crust: brightness(0) saturate(100%) invert(3%) sepia(13%) saturate(6863%) hue-rotate(220deg) brightness(95%) contrast(91%); }; +} +``` + +Select the filter definitions from below that you plan to use and insert them near the top of the `#catppuccin` mixin, below the `@: @catppuccin[@@lookup][@];` color definitions. + +```css +@rosewater-filter: @catppuccin-filters[@@lookup][@rosewater]; +@flamingo-filter: @catppuccin-filters[@@lookup][@flamingo]; +@pink-filter: @catppuccin-filters[@@lookup][@pink]; +@mauve-filter: @catppuccin-filters[@@lookup][@mauve]; +@red-filter: @catppuccin-filters[@@lookup][@red]; +@maroon-filter: @catppuccin-filters[@@lookup][@maroon]; +@peach-filter: @catppuccin-filters[@@lookup][@peach]; +@yellow-filter: @catppuccin-filters[@@lookup][@yellow]; +@green-filter: @catppuccin-filters[@@lookup][@green]; +@teal-filter: @catppuccin-filters[@@lookup][@teal]; +@sky-filter: @catppuccin-filters[@@lookup][@sky]; +@sapphire-filter: @catppuccin-filters[@@lookup][@sapphire]; +@blue-filter: @catppuccin-filters[@@lookup][@blue]; +@lavender-filter: @catppuccin-filters[@@lookup][@lavender]; +@text-filter: @catppuccin-filters[@@lookup][@text]; +@subtext1-filter: @catppuccin-filters[@@lookup][@subtext1]; +@subtext0-filter: @catppuccin-filters[@@lookup][@subtext0]; +@overlay2-filter: @catppuccin-filters[@@lookup][@overlay2]; +@overlay1-filter: @catppuccin-filters[@@lookup][@overlay1]; +@overlay0-filter: @catppuccin-filters[@@lookup][@overlay0]; +@surface2-filter: @catppuccin-filters[@@lookup][@surface2]; +@surface1-filter: @catppuccin-filters[@@lookup][@surface1]; +@surface0-filter: @catppuccin-filters[@@lookup][@surface0]; +@base-filter: @catppuccin-filters[@@lookup][@base]; +@mantle-filter: @catppuccin-filters[@@lookup][@mantle]; +@crust-filter: @catppuccin-filters[@@lookup][@crust]; +@accent-color-filter: @catppuccin-filters[@@lookup][@@accent]; +``` diff --git a/docs/guide/rgb-values.md b/docs/guide/rgb-values.md new file mode 100644 index 00000000..d5512641 --- /dev/null +++ b/docs/guide/rgb-values.md @@ -0,0 +1,9 @@ +You can use the following snippet to get the raw RGB values from a color. + +```less +#rgbify(@color) { + @rgb-raw: red(@color), green(@color), blue(@color); +} + +--ctp-base: #rgbify(@base) []; // -> 30, 30, 46 +``` diff --git a/docs/guide/syntax-highlighting.md b/docs/guide/syntax-highlighting.md new file mode 100644 index 00000000..d7e49410 --- /dev/null +++ b/docs/guide/syntax-highlighting.md @@ -0,0 +1,70 @@ +If a website uses [highlight.js](https://highlightjs.org/), [Pygments](https://pygments.org/), or [Prism.js](https://prismjs.com/) for syntax highlighting, follow the steps for the syntax higlighter in use below. First though, you'll need to add the following lines beneath the color definition section (`@: @catppuccin[@@lookup][@];`) in the `#catppuccin` mixin: + +```css +--ctp-rosewater: @rosewater; +--ctp-flamingo: @flamingo; +--ctp-pink: @pink; +--ctp-mauve: @mauve; +--ctp-red: @red; +--ctp-maroon: @maroon; +--ctp-peach: @peach; +--ctp-yellow: @yellow; +--ctp-green: @green; +--ctp-teal: @teal; +--ctp-sky: @sky; +--ctp-sapphire: @sapphire; +--ctp-blue: @blue; +--ctp-lavender: @lavender; +--ctp-text: @text; +--ctp-subtext1: @subtext1; +--ctp-subtext0: @subtext0; +--ctp-overlay2: @overlay2; +--ctp-overlay1: @overlay1; +--ctp-overlay0: @overlay0; +--ctp-surface2: @surface2; +--ctp-surface1: @surface1; +--ctp-surface0: @surface0; +--ctp-base: @base; +--ctp-mantle: @mantle; +--ctp-crust: @crust; +``` + +## highlight.js + +Add the following line at the top of the userstyle, beneath the `@-moz-document` line. + +```css +@import url("https://unpkg.com/@catppuccin/highlightjs@1.0.0/css/catppuccin-variables.important.css"); +``` + +## Pygments + +Add the following line at the top of the userstyle, beneath the `@-moz-document` line. + +```css +@import url("https://python.catppuccin.com/pygments/catppuccin-variables.important.css"); +``` + +## Prism.js + +Add the following line at the top of the userstyle, beneath the `@-moz-document` line. + +```css +@import url("https://prismjs.catppuccin.com/variables.css"); +``` + +## Chroma + +Add the following lines to the top of the userstyle, beneath the `@-moz-document` line. + +```css +@import (css) + url("https://chroma.catppuccin.com/@{lightFlavor}-chroma-style.css") + (prefers-color-scheme: light); +@import (css) + url("https://chroma.catppuccin.com/@{darkFlavor}-chroma-style.css") + (prefers-color-scheme: dark); +``` + +> [!IMPORTANT] +> The above snippet only works properly for userstyles that use browser/system media queries to apply the `#catppuccin` mixin. If a userstyle targets a specific attribute/element on the website to apply the mixin, this will not work all of the time. diff --git a/docs/tips-and-tricks.md b/docs/tips-and-tricks.md deleted file mode 100644 index 54e4451b..00000000 --- a/docs/tips-and-tricks.md +++ /dev/null @@ -1,227 +0,0 @@ -

-

๐Ÿ“– Tips and tricks for writing a userstyle

-

- -  - -### Table of Contents - - - -- [How can I see my changes in real time?](#how-can-i-see-my-changes-in-real-time) -- [How can I hide sensitive information in preview screenshots?](#how-can-i-hide-sensitive-information-in-preview-screenshots) -- [How do I convert preview images to WebP?](#how-do-i-convert-preview-images-to-webp) - - [Installation](#installation) - - [Usage](#usage) -- [How do I theme images and SVGs?](#how-do-i-theme-images-and-svgs) - - [SVGs as `background-image`s](#svgs-as-background-images) - - [`` elements](#img-elements) -- [How do I set a variable to RGB values?](#how-do-i-set-a-variable-to-rgb-values) -- [How can I inspect hard-to-grab elements?](#how-can-i-inspect-hard-to-grab-elements) -- [How do I theme code blocks / syntax highlighting?](#how-do-i-theme-code-blocks--syntax-highlighting) - - [highlight.js](#highlightjs) - - [Pygments](#pygments) - - [Prism.js](#prismjs) - - - -### How can I see my changes in real time? - -See ["Initial installation and live reload" - Stylus Wiki](https://github.com/openstyles/stylus/wiki/Writing-UserCSS#initial-installation-and-live-reload). - -  - -### How can I hide sensitive information in preview screenshots? - -When taking screenshots of userstyles, you may want to hide sensitive information (such as your username, email, etc.). - -You may use the [Flow Circular](https://fonts.google.com/specimen/Flow+Circular) font to redact details by obscuring any text on the page. - -Use this snippet at the top of your userstyle to import and use the font: - -```less -@import url("https://fonts.googleapis.com/css2?family=Flow+Circular&display=swap"); - -* { - font-family: "Flow Circular", cursive; -} -``` - -  - -### How do I convert preview images to WebP? - -The Catppuccin project prefers to use the [WebP image format](https://en.wikipedia.org/wiki/WebP) for the asset preview images. We recommend using Google's [`cwebp`](https://developers.google.com/speed/webp/docs/cwebp) conversion utility to convert images to WebP. - -#### Installation - -| Method | Instructions | -| ------------------------------------- | -------------------------------------------------------------------------------------- | -| [Homebrew](https://brew.sh/) | `brew install webp` [[view cask]](https://formulae.brew.sh/formula/webp) | -| [MacPorts](https://www.macports.org/) | `sudo port install webp` [[view port]](https://ports.macports.org/port/webp/) | -| Binaries | See https://storage.googleapis.com/downloads.webmproject.org/releases/webp/index.html. | - -#### Usage - -> [!TIP] -> See [the full documentation on `cwebp`](https://developers.google.com/speed/webp/docs/cwebp) for further reference. - -``` -cwebp -lossless old-image.png -o new-image.webp -``` - -The command above is converting the input image `old-image.png` to the output file `new-image-webp`, with a lossless quality conversion. - -  - -### How do I theme images and SVGs? - -#### SVGs as `background-image`s - -Websites will sometimes use the `background-image` CSS property to apply an SVG, often for icons. We will refer to these as "external SVGs" throughout the rest of this guide, as the SVGs are usually at a different URL and linked to with [`url()`](https://developer.mozilla.org/en-US/docs/Web/CSS/url). Below is an example of what a rule for an external SVG could look like. - -```css -.xyz { - background-image: url("https://example.org/assets/xyz.svg"); -} -``` - -The easiest way to theme external SVGs is to visit the URL of the SVG and paste its contents in between the single quotes of the `escape('')` section of the following template: - -```less -.xyz { - @svg: escape("..."); - background-image: url("data:image/svg+xml,@{svg}"); -} -``` - -> [!NOTE] -> The `Invalid % without number` error may appear if you have not done the following step. Make sure to add/replace an interpolated color in the SVG contents (as is detailed below) for this error to go away. - -Now, replace any colors in the SVG with their respective Catppuccin variants. For example, take the following SVG icon for Twitter: - -```xml - -``` - -There is only one color used, `fill="#1D9BF0"`. That hex code is a shade of blue, so we can replace it with the `@blue` color using the `fill="@{}"` syntax ([variable interpolation](https://lesscss.org/features/#variables-feature-variable-interpolation)). - -```less -.twitter-icon { - @svg: escape( - '' - ); - background-image: url("data:image/svg+xml,@{svg}"); -} -``` - -#### `` elements - -Theming an inline image is similar, but `content` is used instead of `background-image` to cover up the original image with our new one. As with the previous tip for `background-image`, you only need to update the SVG inside of the `escape('')` (see above for details). - -```less -img.xyz { - @svg: escape("..."); - content: url("data:image/svg+xml,@{svg}"); -} -``` - -Again, following the example of theming a Twitter logo: - -```less -img.twitter-icon { - @svg: escape( - '' - ); - content: url("data:image/svg+xml,@{svg}"); -} -``` - -  - -### How do I set a variable to RGB values? - -You can use the following snippet to get the raw RGB values from a color. - -```less -#rgbify(@color) { - @rgb-raw: red(@color), green(@color), blue(@color); -} - ---ctp-base: #rgbify(@base) []; // -> 30, 30, 46 -``` - -  - -### How can I inspect hard-to-grab elements? - -Paste the following snippet into your browser console, then trigger the event. Adjust the delay (in milliseconds) as needed. - -```js -setTimeout(function () { - debugger; -}, 3000); -``` - -![](https://i0.wp.com/css-tricks.com/wp-content/uploads/2017/02/debugger.gif?ssl=1) - -GIF via ["Set a Timed Debugger To Web Inspect Hard-To-Grab Elements" - CSS Tricks](https://css-tricks.com/set-timed-debugger-web-inspect-hard-grab-elements/). - -  - -### How do I theme code blocks / syntax highlighting? - -If a website uses [highlight.js](https://highlightjs.org/), [Pygments](https://pygments.org/), or [Prism.js](https://prismjs.com/) for syntax highlighting, follow the steps for the syntax higlighter in use below. First though, you'll need to add the following lines beneath the color definition section (`@: @catppuccin[@@lookup][@];`) in the `#catppuccin` mixin: - -```css ---ctp-rosewater: @rosewater; ---ctp-flamingo: @flamingo; ---ctp-pink: @pink; ---ctp-mauve: @mauve; ---ctp-red: @red; ---ctp-maroon: @maroon; ---ctp-peach: @peach; ---ctp-yellow: @yellow; ---ctp-green: @green; ---ctp-teal: @teal; ---ctp-sky: @sky; ---ctp-sapphire: @sapphire; ---ctp-blue: @blue; ---ctp-lavender: @lavender; ---ctp-text: @text; ---ctp-subtext1: @subtext1; ---ctp-subtext0: @subtext0; ---ctp-overlay2: @overlay2; ---ctp-overlay1: @overlay1; ---ctp-overlay0: @overlay0; ---ctp-surface2: @surface2; ---ctp-surface1: @surface1; ---ctp-surface0: @surface0; ---ctp-base: @base; ---ctp-mantle: @mantle; ---ctp-crust: @crust; -``` - -#### highlight.js - -Add the following line at the top of the userstyle, beneath the `@-moz-document` line. - -```css -@import url("https://unpkg.com/@catppuccin/highlightjs@1.0.0/css/catppuccin-variables.important.css"); -``` - -#### Pygments - -Add the following line at the top of the userstyle, beneath the `@-moz-document` line. - -```css -@import url("https://python.catppuccin.com/pygments/catppuccin-variables.important.css"); -``` - -#### Prism.js - -Add the following line at the top of the userstyle, beneath the `@-moz-document` line. - -```css -@import url("https://prismjs.catppuccin.com/variables.css"); -``` diff --git a/docs/tips-and-tricks/README.md b/docs/tips-and-tricks/README.md new file mode 100644 index 00000000..9fb3152b --- /dev/null +++ b/docs/tips-and-tricks/README.md @@ -0,0 +1,6 @@ +# Tips and Tricks + +- [Convert images to WebP](./convert-images-to-webp.md) +- [Hide sensitive information from preview screenshots](./hide-sensitive-information-from-previews.md) +- [Inspect hard-to-grab elements](./inspect-hard-to-grab-elements.md) +- [See changes in real time (hot reloading)](./see-changes-in-real-time.md) diff --git a/docs/tips-and-tricks/convert-images-to-webp.md b/docs/tips-and-tricks/convert-images-to-webp.md new file mode 100644 index 00000000..6ac1c789 --- /dev/null +++ b/docs/tips-and-tricks/convert-images-to-webp.md @@ -0,0 +1,20 @@ +The Catppuccin project prefers to use the [WebP image format](https://en.wikipedia.org/wiki/WebP) for the asset preview images. We recommend using Google's [`cwebp`](https://developers.google.com/speed/webp/docs/cwebp) conversion utility to convert images to WebP. + +## Installation + +| Method | Instructions | +| ------------------------------------- | ---------------------------------------------------------------------------------------- | +| [Homebrew](https://brew.sh/) | `brew install webp` [[view cask]](https://formulae.brew.sh/formula/webp) | +| [MacPorts](https://www.macports.org/) | `sudo port install webp` [[view port]](https://ports.macports.org/port/webp/) | +| Binaries | See . | + +## Usage + +> [!TIP] +> See [the full documentation on `cwebp`](https://developers.google.com/speed/webp/docs/cwebp) for further reference. + +``` +cwebp -lossless old-image.png -o new-image.webp +``` + +The command above is converting the input image `old-image.png` to the output file `new-image-webp`, with a lossless quality conversion. diff --git a/docs/tips-and-tricks/hide-sensitive-information-from-previews.md b/docs/tips-and-tricks/hide-sensitive-information-from-previews.md new file mode 100644 index 00000000..14273eec --- /dev/null +++ b/docs/tips-and-tricks/hide-sensitive-information-from-previews.md @@ -0,0 +1,15 @@ +When taking screenshots of userstyles, you may want to hide sensitive information (such as your username, email, etc.). + +You can use the [Flow Circular](https://fonts.google.com/specimen/Flow+Circular) font to redact details by obscuring any text on the page. + +Use this snippet at the top of your userstyle to import and use the font: + +```less +@import url("https://fonts.googleapis.com/css2?family=Flow+Circular&display=swap"); + +* { + font-family: "Flow Circular", cursive; +} +``` + +Make sure to remove the snippet once you have taken the preview screenshots. diff --git a/docs/tips-and-tricks/inspect-hard-to-grab-elements.md b/docs/tips-and-tricks/inspect-hard-to-grab-elements.md new file mode 100644 index 00000000..d1d8d51f --- /dev/null +++ b/docs/tips-and-tricks/inspect-hard-to-grab-elements.md @@ -0,0 +1,11 @@ +Paste the following snippet into your browser console, then trigger the event. Adjust the delay (in milliseconds) as needed. + +```js +setTimeout(function () { + debugger; +}, 3000); +``` + +![](https://i0.wp.com/css-tricks.com/wp-content/uploads/2017/02/debugger.gif?ssl=1) + +GIF via ["Set a Timed Debugger To Web Inspect Hard-To-Grab Elements" - CSS Tricks](https://css-tricks.com/set-timed-debugger-web-inspect-hard-grab-elements/). diff --git a/docs/tips-and-tricks/see-changes-in-real-time.md b/docs/tips-and-tricks/see-changes-in-real-time.md new file mode 100644 index 00000000..69dc3bf1 --- /dev/null +++ b/docs/tips-and-tricks/see-changes-in-real-time.md @@ -0,0 +1 @@ +See ["Initial installation and live reload" - Stylus Wiki](https://github.com/openstyles/stylus/wiki/Writing-UserCSS#initial-installation-and-live-reload). diff --git a/docs/tutorials/README.md b/docs/tutorials/README.md new file mode 100644 index 00000000..febd2b07 --- /dev/null +++ b/docs/tutorials/README.md @@ -0,0 +1,3 @@ +# Tutorials + +- [Writing a userstyle (walkthrough)](writing-a-userstyle.md) diff --git a/docs/how-to-write-a-userstyle.md b/docs/tutorials/writing-a-userstyle.md similarity index 93% rename from docs/how-to-write-a-userstyle.md rename to docs/tutorials/writing-a-userstyle.md index bf36c8a0..b7db024a 100644 --- a/docs/how-to-write-a-userstyle.md +++ b/docs/tutorials/writing-a-userstyle.md @@ -1,16 +1,6 @@ -

-

๐Ÿ“– How to write a userstyle

-

+# Writing a userstyle (walkthrough) -

- Beginner-friendly guide for creating a userstyle! -

- -  - -### Table of Contents - - +Beginner-friendly walkthrough of creating a userstyle! - [Prerequisites](#prerequisites) - [Usercss Metadata](#usercss-metadata) @@ -19,9 +9,7 @@ - [The `#catppuccin` mixin](#the-catppuccin-mixin) - [Putting it all together](#putting-it-all-together) - - -### Prerequisites +## Prerequisites - [Stylus](https://github.com/openstyles/stylus) ([Firefox](https://addons.mozilla.org/en-GB/firefox/addon/styl-us/) / [Chrome](https://chrome.google.com/webstore/detail/stylus/clngdbkpkpeebahjckkjfobafhncgmne) extension). @@ -29,7 +17,7 @@ Assuming you have completed steps 1-4 of [Creating Userstyles](./userstyle-creation.md#creating-userstyles), you should have a new `catppuccin.user.css` file under the `styles//` directory. Follow along in that `catppuccin.user.css` file as we write an example userstyle for [example.org](http://example.org/). -### Usercss Metadata +## Usercss Metadata Start by filling out the "metadata block" at the very top of the template. Replace `` with the name of the website you are porting, and please ensure it is capitalized when needed. For `example.org`, it looks like this: @@ -54,7 +42,7 @@ Start by filling out the "metadata block" at the very top of the template. Repla The rest of the metadata block details the preprocessor and the options of the userstyle. This won't need to be changed. For more information, see ["Usercss Metadata" - Stylus Wiki](https://github.com/openstyles/stylus/wiki/Writing-UserCSS#usercss-metadata). -### `@-moz-document` +## `@-moz-document` To tell Stylus which website(s) to apply this userstyle on, replace `` with the domain of your port. For `example.org`, it looks like this: @@ -69,7 +57,7 @@ To tell Stylus which website(s) to apply this userstyle on, replace ` @-moz-document regexp('http://example.(com|net|org|edu)/') { > ``` -### Applying the theme +## Applying the theme This section of the template is about applying the user's light/dark flavors. Read the comments for this section in the template thoroughly and decide which of the two options works best for your port. `example.org` doesn't have a light/dark mode toggle, so we'll apply it based on the user's preferences. @@ -90,7 +78,7 @@ This section of the template is about applying the user's light/dark flavors. Re > [!TIP] > If `example.org` _did_ use a toggle for changing the theme, we suggest using inspect element to try to observe what changes occur when the toggle is adjusted. Typically websites will have a class or attribute on the root `` element. Some examples from our userstyles include `[theme="dark"]`, `.dark`, `.theme-dark`, etc. -### The `#catppuccin` mixin +## The `#catppuccin` mixin > [!TIP] > For more on how Less mixins work, see ["Mixins" - lesscss.org](https://lesscss.org/features/#mixins-feature) and ["A Comprehensive Introduction to Less: Mixins" - SitePoint](https://www.sitepoint.com/a-comprehensive-introduction-to-less-mixins/). @@ -135,7 +123,7 @@ We'll refer to this next section of the template as the "`#catppuccin` mixin". Y } ``` -### Putting it all together +## Putting it all together Combining all of the previous steps, we have a working userstyle! @@ -238,8 +226,8 @@ Combining all of the previous steps, we have a working userstyle! // vim:ft=less ``` -| Original | Themed | -| --------------------------------------- | ------------------------------------- | -| ![](./images/example.org-original.webp) | ![](./images/example.org-themed.webp) | +| Original | Themed | +| ---------------------------------------- | -------------------------------------- | +| ![](../images/example.org-original.webp) | ![](../images/example.org-themed.webp) | -Complete the rest of the steps in [Creating Userstyles](./userstyle-creation.md#creating-userstyles), and then submit your PR! +Complete the rest of the steps in [Userstyle Creation](../userstyle-creation.md), and then submit your PR! diff --git a/docs/userstyle-creation.md b/docs/userstyle-creation.md index a19e100b..a184e169 100644 --- a/docs/userstyle-creation.md +++ b/docs/userstyle-creation.md @@ -1,39 +1,11 @@ -

-

๐ŸŽจ Userstyle Creation

-

- -

- Guidelines for requesting and creating userstyles. -

- -  - -### Table of Contents - - - -- [Requesting userstyles](#requesting-userstyles) -- [Creating userstyles](#creating-userstyles) - - - -### Requesting userstyles - -To request a website to be themed, please create a [Port Request](https://github.com/catppuccin/catppuccin/discussions/new?category=port-requests) discussion on [catppuccin/catppuccin](https://github.com/catppuccin/catppuccin). While this may seem odd, this ensures to keep all of our requests in one place and makes it easier for all people to request what they want without needing to learn what "Stylus" exactly is. - -**If you have already created a userstyle, please raise a -[Pull Request](https://github.com/catppuccin/userstyles/compare)!** - -  - -### Creating userstyles +# Userstyle Creation > [!IMPORTANT] > Websites should be popular or otherwise commonly known by members of the Catppuccin community; personal or niche sites may not meet the criteria. If you are unsure if a website qualifies, consider creating a [discussion](https://github.com/catppuccin/catppuccin/discussions/new?category=port-requests) before submitting an initial PR. -To create a userstyle, follow the instructions below. If you run into any difficulties or have any questions, please check our [Tips and tricks](./tips-and-tricks.md) page first. +To create a userstyle, follow the instructions below. If you are unsure how to theme something, see [Guide](./guide/README.md). If you run into any difficulties or have any questions, feel free to join the [Catppuccin Discord server](https://discord.com/servers/catppuccin-907385605422448742) and find us in the #userstyles channel! -1. Fork this repository. +1. Fork the `catppuccin/userstyles` repository. 2. Create a new branch under the name `feat/`, (e.g. `feat/nixos-search` instead of NixOS Search). 3. Create a new folder `styles/`. The name must be @@ -43,11 +15,11 @@ To create a userstyle, follow the instructions below. If you run into any diffic - **The template uses [LESS](https://lesscss.org/#overview), a preprocessor for Stylus. Please do not change this as we will only accept userstyles based on the template.** -5. [Write the userstyle](./how-to-write-a-userstyle.md). -6. Edit the [`userstyles.yml`](../scripts/userstyles.yml) file and put in the details - of your port. **More details given in [`userstylesyml.md`](./userstylesyml.md).** +5. [Write the userstyle](./tutorials/writing-a-userstyle.md). +6. [Edit the `userstyles.yml` file](./userstylesyml.md) and enter the details + of your port. 7. Create your image preview. - - Take a screenshot of the themed website in each flavor, **with the accent set to `mauve` (the default)**, and then convert all four images [to WebP](./tips-and-tricks.md#how-do-i-convert-preview-images-to-webp) (e.g. `mocha.webp`, + - Take a screenshot of the themed website in each flavor, **with the accent set to `mauve` (the default)**, and then convert all four images [to WebP](../tips/convert-images-to-webp.md) (e.g. `mocha.webp`, `macchiato.webp`, `frappe.webp` & `latte.webp`). - Use [Catwalk](https://github.com/catppuccin/catwalk) to generate a composite or grid image of all the images. **This must be saved as diff --git a/docs/userstylesyml.md b/docs/userstylesyml.md index 364be45d..df3c3a69 100644 --- a/docs/userstylesyml.md +++ b/docs/userstylesyml.md @@ -1,25 +1,14 @@ -

-

๐Ÿ“– userstyles.yml

-

+# userstyles.yml -

- The userstyles.yml file is responsible for tracking all information about each userstyle. -

- -  - -### Table of Contents - - +The [`userstyles.yml`](https://github.com/catppuccin/userstyles/tree/main/scripts/userstyles.yml) file is responsible for tracking all userstyle and maintainer metadata. - [Adding a new userstyle](#adding-a-new-userstyle) - [Adding yourself as a maintainer](#adding-yourself-as-a-maintainer) - [Removing yourself as a maintainer](#removing-yourself-as-a-maintainer) - -### Adding a new userstyle +## Adding a new userstyle -[`userstyles.schema.json`](../scripts/userstyles.schema.json) is the schema +[`userstyles.schema.json`](https://github.com/catppuccin/userstyles/tree/main/scripts/userstyles.schema.json) is the schema specification for `userstyles.yml`. The properties in the following instructions are based on the schema. Please refer to it for clarification. @@ -31,10 +20,10 @@ on the schema. Please refer to it for clarification. You should make changes to everything wrapped in `<>` and remove the `<>` characters. If you need help with any of the fields, refer to other ports in the `userstyles.yml` file. If you would like extra guidance, - you can ask for help in the pull request or join our - [Discord](https://discord.com/servers/catppuccin-907385605422448742). + you can ask for help in the pull request comments or join the + [Catppuccin Discord server](https://discord.com/servers/catppuccin-907385605422448742). - `Required Fields:` + **Required Fields:** ```yaml : @@ -48,7 +37,7 @@ on the schema. Please refer to it for clarification. current-maintainers: [*] ``` - `All Fields:` + **All Fields:** These extra `usage` & `faq` keys will ensure that you can add important information about the port to the README. @@ -79,7 +68,7 @@ on the schema. Please refer to it for clarification. past-maintainers: [*] # OPTIONAL ``` -### Adding yourself as a maintainer +## Adding yourself as a maintainer To add yourself as a maintainer, you need to add your GitHub username to the `collaborators` array in the `userstyles.yml` file. This file is located in the @@ -118,7 +107,7 @@ As a maintainer you will be expected to: - Keep the userstyle up to date with the latest changes. If you no longer wish to maintain a userstyle, see [Removing yourself as a maintainer](#removing-yourself-as-a-maintainer). - Follow our code of conduct and guidelines. -### Removing yourself as a maintainer +## Removing yourself as a maintainer To remove yourself as a maintainer, you will need to move your username from the `current-maintainers` array to the `past-maintainers` array for each of the userstyles you no longer wish to maintain. In the example for YouTube below, the user `elkrien` has been moved from the `current-maintainers` array to the `past-maintainers` array. @@ -136,8 +125,8 @@ userstyles: - past-maintainers: [] + current-maintainers: [*isabelroses] + past-maintainers: [*elkrien] +``` If you would not like to be listed as a past maintainer, you can remove yourself from `collaborators` array entirely. Upon removal, you will also be removed from the `userstyles-maintainers` team. -``` diff --git a/scripts/generate/templates/userstyle-issue.yml b/scripts/generate/templates/userstyle-issue.yml index c13c2f86..344e924e 100644 --- a/scripts/generate/templates/userstyle-issue.yml +++ b/scripts/generate/templates/userstyle-issue.yml @@ -33,7 +33,7 @@ body: - type: input attributes: label: What browser(s) are you seeing the problem on? - description: "The browser version is also important, you can find out how to get that info [here](https://github.com/catppuccin/userstyles/blob/main/docs/browsers.md)." + description: "Make sure to include the browser version - see https://github.com/catppuccin/userstyles/blob/main/docs/browsers.md for instructions." placeholder: Firefox v112.0.2 validations: required: true