Download the PHP package nolte/lean-styleguide without Composer
On this page you can find all versions of the php package nolte/lean-styleguide. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package lean-styleguide
The LEAN Theme's styleguide
View in a single page all your coded UI components.
By default it reads the atoms, molecules, organisms and templates from the components folder of the Lean Theme.0
The styleguide can be accessed on [site-url]/styleguide
How to use
Component Autoload
The UI components will be loaded automatically.
If they don't show up then you may need to pass dummy data. (Read next section)
Passing dummy data to the components in the styleguide
To pass the arguments to the components in the styleguide, you will need to create a json file named exactly as the component and declare the data in the following format:
example:
Component filename: link.php
Component dummy data filename: link.json
Declaring component variants
Simply create another object in the variants array:
example:
Note: the style
argument is a keyword convention in the styleguide.
You can declare multiple styles for a component and they will be printed in the component's heading info section.
Current version supports to 4 styles per component:
style
style2
style3
style4
Setting a variable placeholder
Sometimes it's useful to have a variable placeholder as a component's argument value.
For example if the component uses the function wp_get_attachment_image(), you can set an image placeholder.
Use this hook to create placeholders:
Now you can use the placeholder in the json dummy files like so:
example:
Placeholder usage:
Configurations
Change the template file
Use this filter:
lean_styleguide_template
example:
Adding your own template in the theme's folder.
Important: The custom template will need to have this 3 action calls:
do_action( 'lean_styleguide_header' );
do_action( 'lean_styleguide_content' );
do_action( 'lean_styleguide_footer' );
You can view the styleguide-template.php from this library for reference.
Add code to the Head tag
Use this action: lean_styleguide_header
example:
Add code to the Footer tag
Use this action: lean_styleguide_footer
example:
Change the component's folder path
Use this filter: lean_styleguide_component_dir_path
example:
Change the styleguide's CSS stylesheet
Use this filter: lean_styleguide_css
example: