### Temporary Firefox Installation Source: https://github.com/openstyles/stylus/wiki/Install-Stylus-from-GitHub Guide for temporarily installing the Stylus extension in Firefox. This method is useful for testing and involves loading the extension via `about:debugging#addons`. ```APIDOC Temporary Firefox Installation: 1. Open the URL: `about:debugging#addons` 2. Click the "Load Temporary Add-on" button. 3. Select the extracted "stylus" folder. 4. Select *any* file within the folder. 5. Click "Open". Note: If a permanent version is installed, it will be temporarily hidden and restored on browser restart. Both extensions use the same data. ``` -------------------------------- ### Nightly Test Build Installation Instructions Source: https://github.com/openstyles/stylus/blob/master/README.md Instructions for downloading and installing nightly test builds of Stylus from GitHub Actions. This process involves navigating GitHub, identifying build artifacts, and installing them as unpacked extensions in Chrome or temporarily in Firefox. ```APIDOC Install Nightly Test Builds: 1. Navigate to the CI workflow: https://github.com/openstyles/stylus/actions/workflows/ci.yml 2. Select a specific workflow run entry. 3. Download the build artifact (e.g., `stylus-chrome-mv3-3.0.7-fc0999b`). The name indicates the target browser (Chrome/Chromium), manifest version (mv3), version number, and commit hash. 4. Install the downloaded build: - Chrome/Chromium: Load as an unpacked extension. - Firefox: Install as a temporary extension. Note: When testing in Chrome, disable any existing Stylus extension from the web store to avoid ID conflicts, as unpacked extensions get IDs based on their directory path. ``` -------------------------------- ### Semi-permanent Firefox Installation Source: https://github.com/openstyles/stylus/wiki/Install-Stylus-from-GitHub Instructions for a semi-permanent installation of Stylus in Firefox, compatible with Developer Edition, Nightly, and LibreWolf. Requires zipping extension contents and installing via file. ```APIDOC Semi-permanent Firefox Installation: Prerequisites: Works with Developer Edition, Nightly, LibreWolf. Standard Firefox may not support this. Steps: 1. Zip all contents of the stylus folder (do not zip the folder itself, but its contents). 2. Go to the Firefox `about:addons` page. 3. Click the gear icon at the top and choose "Install Add-on From File..." 4. Select the zip file you created and click "Open." Troubleshooting: - Corrupt add-on message: Ensure the zip file contains files/folders directly, not a parent folder. - Not verified message: Go to `about:config`, search for `xpinstall.signatures.required`, and set it to `false`. Retry installation. ``` -------------------------------- ### Install Stylus in Chrome Source: https://github.com/openstyles/stylus/wiki/Install-Stylus-from-GitHub Steps to install the Stylus extension in Chrome or Chromium-based browsers. This involves enabling developer mode and either dragging the extension file or loading it unpacked. ```APIDOC Install Stylus in Chrome: 1. Open the menu -> Extensions -> Manage, which opens `chrome://extensions` page. 2. Check the `Developer mode` checkbox at the top. 3. In modern Chrome, drag'n'drop the zip file into that page. In some Chromium-based browsers and older Chrome, unpack the zip file first, click `Load unpacked` button, select the extracted folder, and click "OK". 4. Disable any other versions of Stylus that are already installed! ``` -------------------------------- ### Stylus Installation Badges Source: https://github.com/openstyles/stylus/wiki/Writing-UserCSS Markdown code for badges that link directly to UserCSS styles for installation via the Stylus browser extension. Replace MY.USER.CSS with the raw URL of your style. ```Markdown [![Install directly with Stylus](https://img.shields.io/badge/Install%20directly%20with-Stylus-00adad.svg)](MY.USER.CSS) ``` ```Markdown [![Install directly with Stylus](https://img.shields.io/badge/Install%20directly%20with-Stylus-285959.svg)](MY.USER.CSS) ``` ```Markdown [![Install directly with Stylus](https://img.shields.io/badge/Install%20directly%20with-Stylus-238b8b.svg)](MY.USER.CSS) ``` -------------------------------- ### CSS Specificity Example Source: https://github.com/openstyles/stylus/wiki/Writing-styles Demonstrates how to increase CSS selector specificity to override existing styles. It shows example HTML and various CSS selectors with increasing specificity, including the :not(#\0) trick. ```html
text
``` ```css span { color: red !important; } /* More specific selectors */ div > span { /* ... */ } .bar { /* ... */ } div .bar { /* ... */ } #foo .bar { /* ... */ } div#foo > span.bar { /* ... */ } /* Trick to increase specificity */ span:not(#\0) { /* ... */ } span:not(#\0):not(#\0):not(#\0) { /* ... */ } ``` -------------------------------- ### Usercss Format Support Source: https://github.com/openstyles/stylus/blob/master/README.md Stylus supports installing styles from .user.css or .user.styl URLs, following the Usercss format. This allows for styles with customizable parameters directly from URLs. ```APIDOC Usercss Format: Stylus allows installation of styles from URLs that follow the Usercss format, typically ending in `.user.css` or `.user.styl`. Example URL format: `https://example.com/path/to/your/style.user.css` This format supports customizable parameters within the CSS comments, enabling users to configure styles upon installation. ``` -------------------------------- ### Opening Stylus Popup Source: https://github.com/openstyles/stylus/wiki/Popup Instructions on how to open the Stylus extension popup in Chrome, Opera, and Firefox browsers. This includes clicking the extension icon or using keyboard shortcuts. ```APIDOC Open Stylus Popup: - Chrome/Opera: Click the Stylus extension icon on the current page. - Firefox: Click the Stylus addon icon on the current page. - All Browsers: Use a defined keyboard shortcut. Define Keyboard Shortcut: 1. Access Chrome's `chrome://extensions/shortcuts` or Opera's extension shortcuts page. 2. Click the 'Shortcuts' button in the Stylus options panel. 3. Modify the 'Activate the extension shortcut' entry. ``` -------------------------------- ### Stylus @-moz-document URL Prefix Rules Source: https://github.com/openstyles/stylus/wiki/Writing-styles Applies styles to URLs that start with a specified prefix, including the protocol. Wildcards are not permitted. This is useful for matching a range of pages within a domain or protocol. ```APIDOC @-moz-document url-prefix("http://www.example.com/") @-moz-document url-prefix("http://www.example.") @-moz-document url-prefix("http:") ``` -------------------------------- ### Stylus @var Directive Example Source: https://github.com/openstyles/stylus/wiki/Writing-UserCSS An example demonstrating the declaration of a Stylus variable using the `@var` directive, specifying its type, name, label, and default value. ```stylus /* @var