Compare commits
5 Commits
5df1252076
...
2ae40153fc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2ae40153fc | ||
|
|
70f53cea2b | ||
|
|
fdbb03c904 | ||
|
|
2e522a481a | ||
|
|
2b30253ebe |
|
|
@ -35,8 +35,11 @@ function carhop_setup()
|
|||
add_theme_support('wp-block-styles');
|
||||
|
||||
add_theme_support('editor-styles');
|
||||
add_editor_style('css/editor-style.css');
|
||||
add_theme_support('widgets');
|
||||
|
||||
add_editor_style('css/editor-style.css');
|
||||
|
||||
add_post_type_support('page', 'excerpt');
|
||||
// add_post_type_support( 'page', 'excerpt' );
|
||||
}
|
||||
|
||||
|
|
@ -44,33 +47,6 @@ add_action('after_setup_theme', 'carhop_setup');
|
|||
|
||||
|
||||
|
||||
// ##### Menu Walker
|
||||
// if (!function_exists('register_navwalker')) :
|
||||
// function register_navwalker() {
|
||||
// require('includes/navwalker.php');
|
||||
// }
|
||||
// endif;
|
||||
// add_action('after_setup_theme', 'register_navwalker');
|
||||
|
||||
|
||||
|
||||
|
||||
// ##### Walker to ReWrap li submenu parent with button instead of <a>
|
||||
function wrap_parent_menu_item_buttons($output, $item, $depth, $args)
|
||||
{
|
||||
|
||||
if ($args->theme_location === "primary" && in_array('menu-item-has-children', $item->classes, true)) {
|
||||
$output = '<button type="button" class="menu-item-submenu-toggle" aria-expanded="false" aria-controls="sub-menu-' . $item->ID . '">' . $item->title . '</button>';
|
||||
}
|
||||
if ($args->theme_location === "footer" && in_array('menu-item-has-children', $item->classes, true)) {
|
||||
$output = $item->title;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
add_filter('walker_nav_menu_start_el', 'wrap_parent_menu_item_buttons', 10, 4);
|
||||
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------
|
||||
##### Enqueue Theme assets 🡒 Front
|
||||
------------------------------------------------------------------*/
|
||||
|
|
@ -138,44 +114,3 @@ function tailpress_asset($path)
|
|||
|
||||
return add_query_arg('time', time(), get_stylesheet_directory_uri() . '/' . $path);
|
||||
}
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------
|
||||
##### Adds option 'li_class' to 'wp_nav_menu
|
||||
------------------------------------------------------------------*/
|
||||
|
||||
function tailpress_nav_menu_add_li_class($classes, $item, $args, $depth)
|
||||
{
|
||||
if (isset($args->li_class)) {
|
||||
$classes[] = $args->li_class;
|
||||
}
|
||||
|
||||
if (isset($args->{"li_class_$depth"})) {
|
||||
$classes[] = $args->{"li_class_$depth"};
|
||||
}
|
||||
|
||||
return $classes;
|
||||
}
|
||||
|
||||
add_filter('nav_menu_css_class', 'tailpress_nav_menu_add_li_class', 10, 4);
|
||||
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------
|
||||
##### Adds option 'submenu_class' to 'wp_nav_menu'
|
||||
------------------------------------------------------------------*/
|
||||
|
||||
function tailpress_nav_menu_add_submenu_class($classes, $args, $depth)
|
||||
{
|
||||
if (isset($args->submenu_class)) {
|
||||
$classes[] = $args->submenu_class;
|
||||
}
|
||||
|
||||
if (isset($args->{"submenu_class_$depth"})) {
|
||||
$classes[] = $args->{"submenu_class_$depth"};
|
||||
}
|
||||
|
||||
return $classes;
|
||||
}
|
||||
|
||||
add_filter('nav_menu_submenu_css_class', 'tailpress_nav_menu_add_submenu_class', 10, 3);
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@
|
|||
@import './blocks/wp-block-heading.css';
|
||||
@import './blocks/wp-block-list.css';
|
||||
@import './blocks/wp-block-table.css';
|
||||
@import './blocks/wp-block-details.css';
|
||||
|
||||
/* ########### LIBS ############ */
|
||||
@import './libs/swiper.css';
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
min-height: 60vh;
|
||||
|
||||
&:first-child {
|
||||
@apply mt-0;
|
||||
@apply !mt-0;
|
||||
}
|
||||
|
||||
h2 {
|
||||
|
|
|
|||
24
resources/css/blocks/wp-block-details.css
Normal file
24
resources/css/blocks/wp-block-details.css
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
.wp-block-details {
|
||||
@apply border border-primary border-solid p-4;
|
||||
|
||||
summary {
|
||||
@apply font-bold list-none flex items-center justify-between gap-2;
|
||||
|
||||
&::-webkit-details-marker,
|
||||
&::marker {
|
||||
@apply hidden;
|
||||
content: ' ';
|
||||
}
|
||||
&:after {
|
||||
transition: transform 0.5s ease-out;
|
||||
content: ' ';
|
||||
@apply w-10 h-10 block content-[''] bg-no-repeat bg-center bg-contain;
|
||||
background-image: url('../resources/img/elements/select-drop-button.svg');
|
||||
}
|
||||
}
|
||||
&[open] {
|
||||
summary:after {
|
||||
@apply rotate-180;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user