Compare commits

...

5 Commits

Author SHA1 Message Date
598c902b9c copy over custom css from editor to css file
All checks were successful
continuous-integration/drone/push Build is passing
2024-06-13 12:06:44 +05:00
7caf67864d fix typo 2024-06-13 12:05:48 +05:00
02b9d53f27 create custom css file that loads on editor and frontend 2024-06-13 12:04:16 +05:00
289ebea30b add hover underline to post titles on home page 2024-06-13 11:52:41 +05:00
d243a7a2e5 create front page template 2024-06-13 11:50:12 +05:00
4 changed files with 161 additions and 85 deletions

59
assets/css/custom.css Normal file
View File

@ -0,0 +1,59 @@
figcaption.wp-element-caption {
width: fit-content;
margin: 0;
padding: 8px 12px;
}
.main-header-nav .wp-block-navigation-item {
justify-content: center;
border: 1px solid;
flex-grow: 1;
border-left: 0;
padding-block: 0.5em
}
.main-header-nav .wp-block-navigation-item:last-of-type {
border-right: 0;
}
nav.wp-block-navigation.mobile-header-nav {
border-top: 1px solid;
border-bottom: 1px solid;
padding-block: 15px
}
ul.wp-block-navigation.mobile-header-nav li {
font-size: 40px !important;
margin-block: .5em;
}
@media (min-width: 1080px) {
.wp-block-column.footer-gradient-column {
padding-left: 2rem !important;
border-left: 8px solid var(--wp--preset--color--turquoise-green);
}
}
@media (max-width: 786px) {
.wp-block-column.footer-gradient-column {
padding-top: 1.5rem !important;
border-top: 8px solid var(--wp--preset--color--turquoise-green);
}
}
.overlap {
z-index: 21;
}
.home-post-item {
height: 100%
}
.post-title a {
text-decoration: none;
}
.post-title a:hover,
.post-title a:focus {
text-decoration: underline;
}

View File

@ -1,5 +1,97 @@
<?php
// enqueue custom css on front-end and editor
function jett_editor_css() {
add_editor_style( get_theme_file_uri('/assets/css/custom.css') );
}
add_action( 'after_setup_theme', 'jett_editor_css' );
function jett_frontend_css() {
wp_enqueue_style('jett_css', get_theme_file_uri('/assets/css/custom.css'));
}
add_action('wp_enqueue_scripts', 'jett_frontend_css');
// 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' );
/* 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' );

View File

@ -0,0 +1,7 @@
<!-- wp:template-part {"slug":"header"} /-->
<!-- wp:group {"style":{"spacing":{"padding":{"top":"0","bottom":"0"},"margin":{"top":"0","bottom":"0"}}},"layout":{"type":"default"}} -->
<div class="wp-block-group" style="margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0"><!-- wp:post-content /--></div>
<!-- /wp:group -->
<!-- wp:template-part {"slug":"footer","area":"footer"} /-->

View File

@ -1,4 +1,6 @@
{
"version": 3,
"$schema": "https://schemas.wp.org/trunk/theme.json",
"settings": {
"appearanceTools": true,
"color": {
@ -65,7 +67,6 @@
"wideSize": "1760px"
},
"typography": {
"defaultFontSizes": false,
"fontFamilies": [
{
"fontFace": [
@ -636,7 +637,6 @@
}
}
},
"css": "figcaption.wp-element-caption {\n width: fit-content;\n margin: 0;\n padding: 8px 12px;\n}\n\n.main-header-nav .wp-block-navigation-item {\n justify-content: center;\n border: 1px solid;\n flex-grow: 1;\n border-left: 0;\n padding-block: 0.5em\n}\n\n.main-header-nav .wp-block-navigation-item:last-of-type {\n border-right: 0;\n}\n\nnav.wp-block-navigation.mobile-header-nav {\n border-top: 1px solid;\n border-bottom: 1px solid;\n padding-block: 15px\n}\n\nul.wp-block-navigation.mobile-header-nav li {\n font-size: 40px !important;\n margin-block: .5em;\n}\n\n@media (min-width: 1080px) {\n .wp-block-column.footer-gradient-column {\n padding-left: 2rem !important;\n border-left: 8px solid var(--wp--preset--color--turquoise-green);\n}\n}\n\n@media (max-width: 786px) {\n.wp-block-column.footer-gradient-column {\n padding-top: 1.5rem !important;\n border-top: 8px solid var(--wp--preset--color--turquoise-green);\n}\n}\n\n.overlap {\n z-index: 21;\n}",
"elements": {
"caption": {
"color": {
@ -666,7 +666,5 @@
"name": "footer",
"title": "Footer"
}
],
"version": 3,
"$schema": "https://schemas.wp.org/trunk/theme.json"
]
}