diff --git a/assets/css/custom.css b/assets/css/custom.css new file mode 100644 index 0000000..e69de29 diff --git a/functions.php b/functions.php index ce8626c..96c0915 100644 --- a/functions.php +++ b/functions.php @@ -1,5 +1,97 @@ 'gradient', + 'label' => __( 'Gradient', 'jett' ), + 'inline_style' => ' + .wp-block-heading.is-style-gradient { + background: var(--wp--preset--gradient--violet-to-green); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + line-height: 1.1; + } + ' + ) + ); + register_block_style( + 'core/paragraph', + array( + 'name' => 'gradient', + 'label' => __( 'Gradient', 'jett' ), + 'inline_style' => ' + p.is-style-gradient { + background: var(--wp--preset--gradient--violet-to-green); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + line-height: 1.1; + } + ' + ) + ); + register_block_style( + 'core/list', + array( + 'name' => 'arrow', + 'label' => __( 'Arrow', 'lex-scotland' ), + 'inline_style' => ' + ul.is-style-arrow { + list-style: none; + } + ul.is-style-arrow div { + display: inline; + } + ul.is-style-arrow li::before { + content: "→"; + margin-right: 0.5em; + font-weight: bold; + } + ' + ) + ); + register_block_style( + 'core/post-terms', + array( + 'name' => 'hashtags', + 'label' => __('Hashtags', 'lex-scotland'), + 'inline_style' => ' + .is-style-hashtags.taxonomy-post_tag.wp-block-post-terms a::before { + content: "#"; + } + + .is-style-hashtags.taxonomy-post_tag.wp-block-post-terms a { + background: var(--wp--preset--color--black); + padding: .5rem; + display: inline-block; + color: white; + font-family: var(--wp--preset--font-family--instrument-sans); + text-decoration: none; + margin-right: 5px; + margin-bottom: 5px; + font-size: 13px; + font-weight: 500; + } + ' + ) + ); +} +add_action( 'init', 'jett_block_styles' ); + /* Remove default CSS variables that come with Wordpress https://github.com/WordPress/gutenberg/issues/56180#issuecomment-1819222376 */ @@ -53,83 +145,3 @@ function cc_mime_types($mimes) { return $mimes; } add_filter('upload_mimes', 'cc_mime_types'); - -// define block styles -function jett_block_styles() { - register_block_style( - 'core/heading', - array( - 'name' => 'gradient', - 'label' => __( 'Gradient', 'jett' ), - 'inline_style' => ' - .wp-block-heading.is-style-gradient { - background: var(--wp--preset--gradient--violet-to-green); - -webkit-background-clip: text; - -webkit-text-fill-color: transparent; - line-height: 1.1; - } - ' - ) - ); - register_block_style( - 'core/paragraph', - array( - 'name' => 'gradient', - 'label' => __( 'Gradient', 'jett' ), - 'inline_style' => ' - p.is-style-gradient { - background: var(--wp--preset--gradient--violet-to-green); - -webkit-background-clip: text; - -webkit-text-fill-color: transparent; - line-height: 1.1; - } - ' - ) - ); - register_block_style( - 'core/list', - array( - 'name' => 'arrow', - 'label' => __( 'Arrow', 'lex-scotland' ), - 'inline_style' => ' - ul.is-style-arrow { - list-style: none; - } - ul.is-style-arrow div { - display: inline; - } - ul.is-style-arrow li::before { - content: "→"; - margin-right: 0.5em; - font-weight: bold; - } - ' - ) - ); - register_block_style( - 'core/post-terms', - array( - 'name' => 'hashtags', - 'label' => __('Hashtags', 'lex-scotland'), - 'inline_style' => ' - .is-style-hashtags.taxonomy-post_tag.wp-block-post-terms a::before { - content: "#"; - } - - .is-style-hashtags.taxonomy-post_tag.wp-block-post-terms a { - background: var(--wp--preset--color--black); - padding: .5rem; - display: inline-block; - color: white; - font-family: var(--wp--preset--font-family--instrument-sans); - text-decoration: none; - margin-right: 5px; - margin-bottom: 5px; - font-size: 13px; - font-weight: 500; - } - ' - ) - ); -} -add_action( 'init', 'jett_block_styles' );