Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kingkool68/wp-styleguide
Simple plugin for enabling a styleguide for your WordPress theme
https://github.com/kingkool68/wp-styleguide
Last synced: about 6 hours ago
JSON representation
Simple plugin for enabling a styleguide for your WordPress theme
- Host: GitHub
- URL: https://github.com/kingkool68/wp-styleguide
- Owner: kingkool68
- Created: 2018-10-20T02:04:26.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-11-11T00:41:48.000Z (12 months ago)
- Last Synced: 2024-04-14T02:36:56.173Z (7 months ago)
- Language: PHP
- Size: 14.6 KB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# WP Styleguide
This plugin maps requests to `/styleguide/` to a `styleguide` directory in your WordPress theme. this allows you to craft a styelguide and make it accessible via the front end of your website. This comes in handy for keeping a collection of static components that you can visually QA. All of the functions and classes available to your theme should be available to your styleguide pages as well.
For example, given this directory structure...
```
my-theme/
- index.php
- style.css
- functions.php
styleguide/
- index.php
- colors.php
```A request to `/styleguide/colors/` would look for `my-theme/styelguide/colors.php`. What you put in those files is up to you and your styleguide.
## Sass Color Helper function
To get color values from a Sass file you can call `WP_Styleguide::get_sass_colors()` passing in the path to a scss file to parse.You'll get back an array of hex colors keyed by their Sass variables.
Example:
```
array(
'$white' => '#ffffff',
'$black' => '#000000',
);
```