66 lines
		
	
	
		
			2.0 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			66 lines
		
	
	
		
			2.0 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| add_action('init', 'custom_stylesheet');
 | |
|  
 | |
| function custom_stylesheet() {
 | |
|     wp_register_style( 'custom-styles', get_template_directory_uri() . '/style.css' );
 | |
|     wp_enqueue_style( 'custom-styles' );
 | |
| }
 | |
| 
 | |
| add_action( 'wp_enqueue_scripts', 'custom_stylesheet' );
 | |
| 
 | |
| add_action( 'init', 'lex_scotland_block_styles');
 | |
| 
 | |
| function lex_scotland_block_styles() {
 | |
| 	register_block_style( 'core/button', array(
 | |
| 		'name'         => 'thin',
 | |
| 		'label'        => __( 'Thin', 'lex-scotland' ),
 | |
|         'inline_style' => '
 | |
|             .wp-block-button.is-style-thin .wp-element-button {
 | |
|                 padding: 8px 16px;
 | |
|                 background: var(--wp--preset--color--washed-green);
 | |
|                 color: var(--wp--preset--color--contrast);
 | |
|                 border-radius: 0;
 | |
|                 font-size: var(--wp--preset--font-size--small);
 | |
|                 border: 1px solid var(--wp--preset--color--washed-green);
 | |
|                 font-weight: 400;
 | |
|             }
 | |
|             .wp-block-button.is-style-thin .wp-element-button:hover {
 | |
|                 border: 1px dashed;
 | |
|             }
 | |
|         '
 | |
|     ) );
 | |
| 
 | |
|     register_block_style( 'core/paragraph', array(
 | |
| 		'name'         => 'arrow-link',
 | |
| 		'label'        => __( 'Arrow link', 'lex-scotland' ),
 | |
|         'inline_style' => '
 | |
|         p.is-style-arrow-link a:after {
 | |
|             display: inline-block;
 | |
|             content: "🡭";
 | |
|             padding-inline-start: 0.25rem;
 | |
|             vertical-align: middle;
 | |
|         }
 | |
|         '
 | |
|     ) );
 | |
| 
 | |
|     register_block_style( 'core/paragraph', array(
 | |
| 		'name'         => 'constrained',
 | |
| 		'label'        => __( 'Constrained', 'lex-scotland' ),
 | |
|         'inline_style' => '
 | |
|             p.is-style-constrained {
 | |
|                 max-width: 50ch;
 | |
|             }
 | |
|         '
 | |
|     ) );
 | |
| 
 | |
|     register_block_style( 'core/list-item', array(
 | |
| 		'name'         => 'constrained',
 | |
| 		'label'        => __( 'Constrained', 'lex-scotland' ),
 | |
|         'inline_style' => '
 | |
|             li.is-style-constrained {
 | |
|                 max-width: 50ch;
 | |
|             }
 | |
|         '
 | |
|     ) );
 | |
| } |