generator-chisel 2.2.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +1 -11
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/fonts/manrope-700.woff2 +0 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/fonts/manrope-regular.woff2 +0 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/fonts/roboto-300.woff2 +0 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/fonts/roboto-700.woff2 +0 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/fonts/roboto-regular.woff2 +0 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/Helpers/BlocksHelpers.php +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/Traits/PageBlocks.php +56 -3
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/WP/ChiselImage.php +4 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/WP/ChiselPost.php +3 -2
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/WP/ChiselProduct.php +3 -2
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/WP/ChiselProductCategory.php +3 -2
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/WP/Components.php +25 -11
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/WP/CustomPostTypes.php +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/WP/Site.php +1 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/WP/Twig.php +2 -2
- package/lib/commands/create/creators/app/chisel-starter-theme/src/blocks/accordion/style.scss +2 -2
- package/lib/commands/create/creators/app/chisel-starter-theme/src/blocks-acf/slider/block.json +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/src/design/tools/_buttons.scss +31 -66
- package/lib/commands/create/creators/app/chisel-starter-theme/src/design/tools/_colors.scss +5 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/design/tools/_icon.scss +1 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/design/tools/_index.scss +1 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/design/tools/_link.scss +1 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/scripts/admin/acf.js +1 -2
- package/lib/commands/create/creators/app/chisel-starter-theme/src/scripts/modules/utils.js +15 -5
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/blocks/_core-button.scss +13 -27
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/blocks/_core-latest-posts.scss +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/blocks/_core-media-text.scss +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/blocks/_core-query.scss +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/blocks/_core.scss +4 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/_badge.scss +3 -3
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/_buttons.scss +14 -28
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/_footer.scss +6 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/_header.scss +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/_main-nav.scss +5 -5
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/_pagination.scss +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/_post-card.scss +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/_post.scss +3 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/_posts-items.scss +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/_sidebar.scss +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/_slider.scss +3 -3
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/elements/_form.scss +3 -3
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/elements/_shared.scss +4 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/login.scss +2 -2
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/objects/_wrapper.scss +5 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/woo/_general.scss +2 -2
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/woo/_notices.scss +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/woo/_product.scss +2 -2
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/wp-editor/_block-edit-selector.scss +2 -2
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/wp-editor/_core-spacer.scss +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/wp-editor/_render-appender.scss +2 -2
- package/lib/commands/create/creators/app/chisel-starter-theme/style.chisel-tpl.css +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/theme.json +150 -37
- package/lib/commands/create/creators/app/chisel-starter-theme/views/components/footer.twig +8 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/views/index.twig +3 -3
- package/lib/commands/create/creators/app/chisel-starter-theme/views/sidebar-blog.twig +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/views/sidebar-woocommerce.twig +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/views/single.twig +6 -4
- package/lib/commands/create/creators/app/chisel-starter-theme/views/woocommerce/archive-product.twig +2 -2
- package/lib/commands/create/creators/app/chisel-starter-theme/views/woocommerce/linked-products.twig +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/views/woocommerce/single-product.twig +3 -3
- package/lib/commands/create/creators/app/chisel-starter-theme/webpack.config.js +11 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/woocommerce.php +1 -1
- package/lib/commands/create/packages-versions.js +1 -1
- package/package.json +2 -2
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/fonts/quicksand-700.woff2 +0 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/fonts/quicksand-regular.woff2 +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
<!-- INSERT-NEW-ENTRIES-HERE -->
|
|
4
4
|
|
|
5
|
+
## <small>2.2.1 (2025-11-05)</small>
|
|
6
|
+
|
|
7
|
+
- fixes and defaults adjustments, improvements ([8d0ceca](https://github.com/xfiveco/generator-chisel/commit/8d0ceca))
|
|
8
|
+
- responsive image and get_thumbnail adjustments ([1d5366f](https://github.com/xfiveco/generator-chisel/commit/1d5366f))
|
|
9
|
+
- update theme version ([8f1b860](https://github.com/xfiveco/generator-chisel/commit/8f1b860))
|
|
10
|
+
|
|
5
11
|
## 2.2.0 (2025-10-22)
|
|
6
12
|
|
|
7
13
|
- composer update, min req php 8.2, refactor to modern php ([d55aae0](https://github.com/xfiveco/generator-chisel/commit/d55aae0))
|
package/README.md
CHANGED
|
@@ -2,17 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/generator-chisel)
|
|
4
4
|
|
|
5
|
-
Chisel is a development framework for creating easy to maintain and fast WordPress websites
|
|
6
|
-
|
|
7
|
-
## Learn more
|
|
8
|
-
- [Introduction](https://www.getchisel.co/)
|
|
9
|
-
- [Documentation](https://www.getchisel.co/docs/)
|
|
10
|
-
- [Installation](https://www.getchisel.co/docs/installation/)
|
|
11
|
-
- [Project Setup](https://www.getchisel.co/docs/setup/)
|
|
12
|
-
- [Project Structure](https://www.getchisel.co/docs/structure/)
|
|
13
|
-
- [Development](https://www.getchisel.co/docs/development/)
|
|
14
|
-
- [In Simple Terms](https://www.getchisel.co/docs/simple/)
|
|
15
|
-
- [Tutorials](https://www.getchisel.co/tutorials/)
|
|
5
|
+
Chisel is a development framework for creating easy to maintain and fast WordPress websites.
|
|
16
6
|
|
|
17
7
|
## License
|
|
18
8
|
Chisel is licensed under [MIT License](LICENSE).
|
|
Binary file
|
package/lib/commands/create/creators/app/chisel-starter-theme/assets/fonts/manrope-regular.woff2
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/commands/create/creators/app/chisel-starter-theme/assets/fonts/roboto-regular.woff2
ADDED
|
Binary file
|
|
@@ -74,7 +74,7 @@ final class BlocksHelpers {
|
|
|
74
74
|
$context['post_id'] = $post_id;
|
|
75
75
|
$context['slug'] = $slug;
|
|
76
76
|
$context['is_preview'] = $is_preview;
|
|
77
|
-
$context['fields'] = function_exists( 'get_fields' ) ? get_fields() : array();
|
|
77
|
+
$context['fields'] = function_exists( 'get_fields' ) ? get_fields( $block['id'] ) : array();
|
|
78
78
|
$classes = array_merge(
|
|
79
79
|
array( $slug ),
|
|
80
80
|
isset( $block['className'] ) ? array( $block['className'] ) : array(),
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
namespace Chisel\Traits;
|
|
4
4
|
|
|
5
|
+
use Timber\Timber;
|
|
6
|
+
|
|
5
7
|
trait PageBlocks {
|
|
6
8
|
/**
|
|
7
9
|
* Content blocks from current page
|
|
@@ -26,8 +28,18 @@ trait PageBlocks {
|
|
|
26
28
|
|
|
27
29
|
$content_blocks_names = array();
|
|
28
30
|
|
|
29
|
-
if ( $post instanceof \WP_Post
|
|
30
|
-
$
|
|
31
|
+
if ( $post instanceof \WP_Post ) {
|
|
32
|
+
$content = $post->post_content . $this->get_sidebar_content();
|
|
33
|
+
|
|
34
|
+
if ( empty( $content ) ) {
|
|
35
|
+
return $content_blocks_names;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if ( ! has_blocks( $content ) ) {
|
|
39
|
+
return $content_blocks_names;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
$blocks = parse_blocks( $content );
|
|
31
43
|
|
|
32
44
|
if ( is_array( $blocks ) && ! empty( $blocks ) ) {
|
|
33
45
|
$blocks_names = $this->get_blocks_names( $blocks );
|
|
@@ -36,7 +48,7 @@ trait PageBlocks {
|
|
|
36
48
|
$blocks_names = array_filter(
|
|
37
49
|
$blocks_names,
|
|
38
50
|
function ( string $block_name ) use ( $prefix ): bool {
|
|
39
|
-
return
|
|
51
|
+
return strpos( $block_name, $prefix ) !== false;
|
|
40
52
|
}
|
|
41
53
|
);
|
|
42
54
|
|
|
@@ -89,4 +101,45 @@ trait PageBlocks {
|
|
|
89
101
|
|
|
90
102
|
return $blocks_names;
|
|
91
103
|
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Get currently active sidebar content in order to parse its blocks.
|
|
107
|
+
*
|
|
108
|
+
* @return string
|
|
109
|
+
*/
|
|
110
|
+
private function get_sidebar_content(): string {
|
|
111
|
+
$context = Timber::context();
|
|
112
|
+
$sidebar = $context['sidebar'];
|
|
113
|
+
$content = '';
|
|
114
|
+
|
|
115
|
+
if ( $sidebar ) {
|
|
116
|
+
$sidebars_widgets = get_option( 'sidebars_widgets', array() );
|
|
117
|
+
|
|
118
|
+
if ( ! isset( $sidebars_widgets[ $sidebar['name'] ] ) ) {
|
|
119
|
+
return '';
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
$sidebar_widgets = $sidebars_widgets[ $sidebar['name'] ];
|
|
123
|
+
|
|
124
|
+
if ( empty( $sidebar_widgets ) ) {
|
|
125
|
+
return '';
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
$sidebars_blocks = get_option( 'widget_block', array() );
|
|
129
|
+
|
|
130
|
+
if ( empty( $sidebars_blocks ) ) {
|
|
131
|
+
return '';
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
foreach ( $sidebar_widgets as $widget_id ) {
|
|
135
|
+
$block_index = str_replace( 'block-', '', $widget_id );
|
|
136
|
+
|
|
137
|
+
if ( isset( $sidebars_blocks[ $block_index ] ) ) {
|
|
138
|
+
$content .= $sidebars_blocks[ $block_index ]['content'];
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return $content;
|
|
144
|
+
}
|
|
92
145
|
}
|
|
@@ -20,6 +20,10 @@ class ChiselImage extends TimberImage {
|
|
|
20
20
|
* @return string The responsive <img> HTML.
|
|
21
21
|
*/
|
|
22
22
|
public function responsive( string $size = 'medium', array $attrs = array() ): string {
|
|
23
|
+
if ( isset( $attrs['class'] ) ) {
|
|
24
|
+
$attrs['class'] .= sprintf( ' wp-image-%s size-%s', absint( $this->ID ), esc_attr( $size ) );
|
|
25
|
+
}
|
|
26
|
+
|
|
23
27
|
return wp_get_attachment_image( $this->ID, $size, false, $attrs );
|
|
24
28
|
}
|
|
25
29
|
}
|
|
@@ -24,16 +24,17 @@ class ChiselPost extends TimberPost {
|
|
|
24
24
|
* Get the post thumbnail. Returns the thumbnail responsive image html.
|
|
25
25
|
*
|
|
26
26
|
* @param string $size Thumbnail size.
|
|
27
|
+
* @param array $attrs Image attributes.
|
|
27
28
|
*
|
|
28
29
|
* @return string Responsive <img> HTML, or empty string.
|
|
29
30
|
*/
|
|
30
|
-
public function get_thumbnail( string $size = 'medium' ): string {
|
|
31
|
+
public function get_thumbnail( string $size = 'medium', array $attrs = array() ): string {
|
|
31
32
|
if ( $this->thumbnail_html === null ) {
|
|
32
33
|
$this->thumbnail_html = '';
|
|
33
34
|
|
|
34
35
|
if ( has_post_thumbnail( $this->ID ) ) {
|
|
35
36
|
$thumbnail_id = get_post_thumbnail_id( $this->ID );
|
|
36
|
-
$this->thumbnail_html = ImageHelpers::get_responsive_image( $thumbnail_id, $size );
|
|
37
|
+
$this->thumbnail_html = ImageHelpers::get_responsive_image( $thumbnail_id, $size, $attrs );
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
40
|
|
|
@@ -31,16 +31,17 @@ class ChiselProduct extends TimberPost {
|
|
|
31
31
|
* Get the product thumbnail. Returns the thumbnail responsive image html.
|
|
32
32
|
*
|
|
33
33
|
* @param string $size Thumbnail size.
|
|
34
|
+
* @param array $attrs Image attributes.
|
|
34
35
|
*
|
|
35
36
|
* @return string Responsive <img> HTML, or empty string.
|
|
36
37
|
*/
|
|
37
|
-
public function get_thumbnail( string $size = 'woocommerce_thumbnail' ): string {
|
|
38
|
+
public function get_thumbnail( string $size = 'woocommerce_thumbnail', array $attrs = array() ): string {
|
|
38
39
|
$size = apply_filters( 'single_product_archive_thumbnail_size', $size );
|
|
39
40
|
|
|
40
41
|
if ( $this->thumbnail_html === null ) {
|
|
41
42
|
$thumbnail_id = $this->get_thumbnail_id();
|
|
42
43
|
|
|
43
|
-
$this->thumbnail_html = $thumbnail_id ? ImageHelpers::get_responsive_image( $thumbnail_id, $size ) : '';
|
|
44
|
+
$this->thumbnail_html = $thumbnail_id ? ImageHelpers::get_responsive_image( $thumbnail_id, $size, $attrs ) : '';
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
return $this->thumbnail_html;
|
package/lib/commands/create/creators/app/chisel-starter-theme/inc/WP/ChiselProductCategory.php
CHANGED
|
@@ -30,16 +30,17 @@ class ChiselProductCategory extends TimberTerm {
|
|
|
30
30
|
* Get the product thumbnail. Returns the thumbnail responsive image html.
|
|
31
31
|
*
|
|
32
32
|
* @param string $size Thumbnail size.
|
|
33
|
+
* @param array $attrs Image attributes.
|
|
33
34
|
*
|
|
34
35
|
* @return string Responsive <img> HTML, or empty string.
|
|
35
36
|
*/
|
|
36
|
-
public function get_thumbnail( string $size = 'woocommerce_thumbnail' ) {
|
|
37
|
+
public function get_thumbnail( string $size = 'woocommerce_thumbnail', array $attrs = array() ): string {
|
|
37
38
|
$size = apply_filters( 'subcategory_archive_thumbnail_size', $size );
|
|
38
39
|
|
|
39
40
|
if ( $this->thumbnail_html === null ) {
|
|
40
41
|
$thumbnail_id = $this->get_thumbnail_id();
|
|
41
42
|
|
|
42
|
-
$this->thumbnail_html = $thumbnail_id ? ImageHelpers::get_responsive_image( $thumbnail_id, $size ) : '';
|
|
43
|
+
$this->thumbnail_html = $thumbnail_id ? ImageHelpers::get_responsive_image( $thumbnail_id, $size, $attrs ) : '';
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
return $this->thumbnail_html;
|
|
@@ -31,9 +31,9 @@ final class Components {
|
|
|
31
31
|
/**
|
|
32
32
|
* The sidebar widgets.
|
|
33
33
|
*
|
|
34
|
-
* @var
|
|
34
|
+
* @var array
|
|
35
35
|
*/
|
|
36
|
-
private static
|
|
36
|
+
private static array $sidebar = array();
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* The footer sidebars.
|
|
@@ -102,22 +102,36 @@ final class Components {
|
|
|
102
102
|
*
|
|
103
103
|
* @param string $sidebar_id The sidebar id.
|
|
104
104
|
*
|
|
105
|
-
* @return
|
|
105
|
+
* @return ?array
|
|
106
106
|
*/
|
|
107
|
-
public static function get_sidebar( string $sidebar_id = '' ):
|
|
108
|
-
|
|
109
|
-
return self::$sidebar;
|
|
110
|
-
}
|
|
107
|
+
public static function get_sidebar( string $sidebar_id = '' ): ?array {
|
|
108
|
+
$sidebar_name = null;
|
|
111
109
|
|
|
112
110
|
if ( $sidebar_id ) {
|
|
113
|
-
|
|
111
|
+
$sidebar_name = 'chisel-sidebar-' . $sidebar_id;
|
|
114
112
|
} elseif ( is_singular( 'post' ) ) {
|
|
115
|
-
|
|
113
|
+
$sidebar_name = 'chisel-sidebar-blog';
|
|
116
114
|
} elseif ( function_exists( 'is_shop' ) && is_shop() ) {
|
|
117
|
-
|
|
115
|
+
$sidebar_name = 'chisel-sidebar-woocommerce';
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if ( ! $sidebar_name ) {
|
|
119
|
+
return null;
|
|
118
120
|
}
|
|
119
121
|
|
|
120
|
-
|
|
122
|
+
if ( isset( self::$sidebar[ $sidebar_name ] ) ) {
|
|
123
|
+
return self::$sidebar[ $sidebar_name ];
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
$sidebar_content = Timber::get_widgets( $sidebar_name );
|
|
127
|
+
|
|
128
|
+
self::$sidebar[ $sidebar_name ] = array(
|
|
129
|
+
'id' => $sidebar_id,
|
|
130
|
+
'name' => $sidebar_name,
|
|
131
|
+
'content' => $sidebar_content,
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
return self::$sidebar[ $sidebar_name ];
|
|
121
135
|
}
|
|
122
136
|
|
|
123
137
|
/**
|
|
@@ -109,7 +109,7 @@ final class CustomPostTypes implements InstanceInterface, HooksInterface {
|
|
|
109
109
|
// 'singular' => __( 'Chisel CPT', 'chisel' ),
|
|
110
110
|
// 'plural' => __( 'Chisel CPTs', 'chisel' ),
|
|
111
111
|
// 'supports' => array( 'editor', 'thumbnail', 'excerpt' ),
|
|
112
|
-
// '
|
|
112
|
+
// 'menu_icon' => 'dashicons-location-alt',
|
|
113
113
|
// 'hierarchical' => true,
|
|
114
114
|
// 'public' => true,
|
|
115
115
|
// 'menu_position' => 20,
|
|
@@ -60,6 +60,7 @@ final class Site extends TimberSite implements InstanceInterface, HooksInterface
|
|
|
60
60
|
$context['logo'] = Components::get_logo();
|
|
61
61
|
$context['menus'] = Components::get_menus();
|
|
62
62
|
$context['sidebar'] = Components::get_sidebar();
|
|
63
|
+
$context['copyright'] = Components::get_sidebar( 'copyright' );
|
|
63
64
|
$context['footer_sidebars'] = Components::get_footer_sidebars();
|
|
64
65
|
$context['the_title'] = Components::get_the_title();
|
|
65
66
|
|
|
@@ -156,9 +156,9 @@ final class Twig implements InstanceInterface, HooksInterface {
|
|
|
156
156
|
* Get the navigation menu.
|
|
157
157
|
*
|
|
158
158
|
* @param string $menu_name The menu name.
|
|
159
|
-
* @return string
|
|
159
|
+
* @return mixed - The menu object or empty string
|
|
160
160
|
*/
|
|
161
|
-
public function get_nav_menu( string $menu_name ):
|
|
161
|
+
public function get_nav_menu( string $menu_name ): mixed {
|
|
162
162
|
$context = Timber::context();
|
|
163
163
|
|
|
164
164
|
return $context['menus'][$menu_name] ?? '';
|
package/lib/commands/create/creators/app/chisel-starter-theme/src/blocks/accordion/style.scss
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
margin: get-margin('small') 0;
|
|
24
24
|
overflow: hidden;
|
|
25
25
|
background-color: get-color('white');
|
|
26
|
-
border: 1px solid get-color('
|
|
26
|
+
border: 1px solid get-color('grey-100');
|
|
27
27
|
border-radius: get-border-radius('small');
|
|
28
28
|
}
|
|
29
29
|
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
justify-content: space-between;
|
|
34
34
|
padding: get-padding('small');
|
|
35
35
|
cursor: pointer;
|
|
36
|
-
background-color: get-color('
|
|
36
|
+
background-color: get-color('grey-100');
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
.b-accordion__item-title {
|
package/lib/commands/create/creators/app/chisel-starter-theme/src/design/tools/_buttons.scss
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
@use 'theme' as *;
|
|
2
2
|
@use 'icon' as *;
|
|
3
3
|
@use 'px-to-rem' as *;
|
|
4
|
+
@use 'colors' as *;
|
|
4
5
|
|
|
5
6
|
@mixin button() {
|
|
6
7
|
box-sizing: border-box;
|
|
7
8
|
display: inline-flex;
|
|
8
9
|
align-items: center;
|
|
9
|
-
padding:
|
|
10
|
+
padding: px-rem(14) px-rem(24);
|
|
10
11
|
font-size: get-font-size('normal');
|
|
11
12
|
font-weight: 400;
|
|
12
|
-
line-height:
|
|
13
|
+
line-height: px-rem(24);
|
|
13
14
|
text-decoration: none;
|
|
14
15
|
appearance: none;
|
|
15
16
|
cursor: pointer;
|
|
16
|
-
border:
|
|
17
|
+
border: 2px solid transparent;
|
|
17
18
|
border-radius: get-border-radius('little');
|
|
18
19
|
transition: get-transition('normal');
|
|
19
20
|
|
|
@@ -28,21 +29,6 @@
|
|
|
28
29
|
opacity: 0.5;
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
@mixin button-icon() {
|
|
32
|
-
padding-top: px-rem(10);
|
|
33
|
-
padding-bottom: px-rem(10);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
@mixin button-icon-small() {
|
|
37
|
-
padding-top: px-rem(6);
|
|
38
|
-
padding-bottom: px-rem(6);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
@mixin button-icon-large() {
|
|
42
|
-
padding-top: px-rem(14);
|
|
43
|
-
padding-bottom: px-rem(14);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
32
|
@mixin button-primary() {
|
|
47
33
|
color: get-color('white');
|
|
48
34
|
background-color: get-color('primary');
|
|
@@ -51,8 +37,12 @@
|
|
|
51
37
|
|
|
52
38
|
@mixin button-primary-hover() {
|
|
53
39
|
color: get-color('white');
|
|
54
|
-
background-color: get-color('
|
|
55
|
-
border-color: get-color('
|
|
40
|
+
background-color: get-color('primary-300');
|
|
41
|
+
border-color: get-color('primary-300');
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@mixin button-primary-focus() {
|
|
45
|
+
outline: 4px solid rgba-color('primary', 50%);
|
|
56
46
|
}
|
|
57
47
|
|
|
58
48
|
@mixin button-primary-icon() {
|
|
@@ -73,6 +63,10 @@
|
|
|
73
63
|
border-color: get-color('primary');
|
|
74
64
|
}
|
|
75
65
|
|
|
66
|
+
@mixin button-primary-outline-focus() {
|
|
67
|
+
outline: 4px solid rgba-color('primary', 50%);
|
|
68
|
+
}
|
|
69
|
+
|
|
76
70
|
@mixin button-primary-outline-icon() {
|
|
77
71
|
&::after {
|
|
78
72
|
background-color: get-color('primary');
|
|
@@ -87,8 +81,8 @@
|
|
|
87
81
|
|
|
88
82
|
@mixin button-secondary() {
|
|
89
83
|
color: get-color('white');
|
|
90
|
-
background-color: get-color('
|
|
91
|
-
border-color: get-color('
|
|
84
|
+
background-color: get-color('foreground');
|
|
85
|
+
border-color: get-color('foreground');
|
|
92
86
|
}
|
|
93
87
|
|
|
94
88
|
@mixin button-secondary-hover() {
|
|
@@ -97,74 +91,45 @@
|
|
|
97
91
|
border-color: get-color('primary');
|
|
98
92
|
}
|
|
99
93
|
|
|
94
|
+
@mixin button-secondary-focus() {
|
|
95
|
+
outline: 4px solid rgba-color('primary', 50%);
|
|
96
|
+
}
|
|
97
|
+
|
|
100
98
|
@mixin button-secondary-outline() {
|
|
101
|
-
color: get-color('
|
|
99
|
+
color: get-color('foreground');
|
|
102
100
|
background-color: transparent;
|
|
103
|
-
border-color: get-color('
|
|
101
|
+
border-color: get-color('foreground');
|
|
104
102
|
}
|
|
105
103
|
|
|
106
104
|
@mixin button-secondary-outline-hover() {
|
|
107
105
|
color: get-color('white');
|
|
108
|
-
background-color: get-color('
|
|
109
|
-
border-color: get-color('
|
|
106
|
+
background-color: get-color('foreground');
|
|
107
|
+
border-color: get-color('foreground');
|
|
110
108
|
}
|
|
111
109
|
|
|
112
|
-
@mixin button-secondary-outline-
|
|
113
|
-
|
|
114
|
-
background-color: get-color('secondary');
|
|
115
|
-
}
|
|
110
|
+
@mixin button-secondary-outline-focus() {
|
|
111
|
+
outline: 4px solid rgba-color('foreground', 50%);
|
|
116
112
|
}
|
|
117
113
|
|
|
118
|
-
@mixin button-secondary-outline-icon
|
|
119
|
-
&::after {
|
|
120
|
-
background-color: get-color('white');
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
@mixin button-tertiary() {
|
|
125
|
-
color: get-color('white');
|
|
126
|
-
background-color: get-color('black');
|
|
127
|
-
border-color: get-color('black');
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
@mixin button-tertiary-hover() {
|
|
131
|
-
color: get-color('white');
|
|
132
|
-
background-color: get-color('grey');
|
|
133
|
-
border-color: get-color('grey');
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
@mixin button-tertiary-outline() {
|
|
137
|
-
color: get-color('black');
|
|
138
|
-
background-color: transparent;
|
|
139
|
-
border-color: get-color('black');
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
@mixin button-tertiary-outline-hover() {
|
|
143
|
-
color: get-color('white');
|
|
144
|
-
background-color: get-color('black');
|
|
145
|
-
border-color: get-color('black');
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
@mixin button-tertiary-outline-icon() {
|
|
114
|
+
@mixin button-secondary-outline-icon() {
|
|
149
115
|
&::after {
|
|
150
|
-
background-color: get-color('
|
|
116
|
+
background-color: get-color('foreground');
|
|
151
117
|
}
|
|
152
118
|
}
|
|
153
119
|
|
|
154
|
-
@mixin button-
|
|
120
|
+
@mixin button-secondary-outline-icon-hover() {
|
|
155
121
|
&::after {
|
|
156
122
|
background-color: get-color('white');
|
|
157
123
|
}
|
|
158
124
|
}
|
|
159
125
|
|
|
160
126
|
@mixin button-small() {
|
|
161
|
-
padding:
|
|
127
|
+
padding: px-rem(10) px-rem(20);
|
|
162
128
|
font-size: get-font-size('small');
|
|
163
|
-
line-height: get-line-height('normal');
|
|
164
129
|
}
|
|
165
130
|
|
|
166
131
|
@mixin button-large() {
|
|
167
|
-
padding:
|
|
132
|
+
padding: px-rem(16) px-rem(28);
|
|
168
133
|
}
|
|
169
134
|
|
|
170
135
|
@mixin button-loading($color: currentColor) {
|
|
@@ -34,8 +34,7 @@ class ACF {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
megaMenuFields() {
|
|
37
|
-
jQuery(document).on('menu-item-added', (
|
|
38
|
-
console.log('menu-item-added', event);
|
|
37
|
+
jQuery(document).on('menu-item-added', () => {
|
|
39
38
|
this.megaMenuData.submenuFields = document.querySelectorAll(
|
|
40
39
|
this.megaMenuData.submenuFieldsSelector,
|
|
41
40
|
);
|
|
@@ -6,11 +6,21 @@ class Utils {
|
|
|
6
6
|
ajax: { url, nonce },
|
|
7
7
|
} = chiselScripts;
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
formData
|
|
13
|
-
}
|
|
9
|
+
let formData;
|
|
10
|
+
|
|
11
|
+
if (ajaxData instanceof FormData) {
|
|
12
|
+
formData = ajaxData;
|
|
13
|
+
} else {
|
|
14
|
+
formData = new FormData();
|
|
15
|
+
|
|
16
|
+
Object.entries(ajaxData).forEach(([key, value]) => {
|
|
17
|
+
if (typeof value === 'object' && value !== null && !['file', 'files'].includes(key)) {
|
|
18
|
+
formData.append(key, JSON.stringify(value));
|
|
19
|
+
} else {
|
|
20
|
+
formData.append(key, value);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
14
24
|
|
|
15
25
|
const params = {
|
|
16
26
|
method: 'POST',
|
package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/blocks/_core-button.scss
CHANGED
|
@@ -25,6 +25,10 @@ $_static-icons: settings.$static-icons;
|
|
|
25
25
|
&:focus {
|
|
26
26
|
@include button-primary-hover;
|
|
27
27
|
}
|
|
28
|
+
|
|
29
|
+
&:focus {
|
|
30
|
+
@include button-primary-focus;
|
|
31
|
+
}
|
|
28
32
|
}
|
|
29
33
|
|
|
30
34
|
&.is-style-primary-outline .wp-block-button__link {
|
|
@@ -36,6 +40,10 @@ $_static-icons: settings.$static-icons;
|
|
|
36
40
|
@include button-primary-outline-hover;
|
|
37
41
|
@include button-primary-outline-icon-hover;
|
|
38
42
|
}
|
|
43
|
+
|
|
44
|
+
&:focus {
|
|
45
|
+
@include button-primary-outline-focus;
|
|
46
|
+
}
|
|
39
47
|
}
|
|
40
48
|
|
|
41
49
|
&.is-style-secondary .wp-block-button__link {
|
|
@@ -45,6 +53,10 @@ $_static-icons: settings.$static-icons;
|
|
|
45
53
|
&:focus {
|
|
46
54
|
@include button-secondary-hover;
|
|
47
55
|
}
|
|
56
|
+
|
|
57
|
+
&:focus {
|
|
58
|
+
@include button-secondary-focus;
|
|
59
|
+
}
|
|
48
60
|
}
|
|
49
61
|
|
|
50
62
|
&.is-style-secondary-outline .wp-block-button__link {
|
|
@@ -56,25 +68,9 @@ $_static-icons: settings.$static-icons;
|
|
|
56
68
|
@include button-secondary-outline-hover;
|
|
57
69
|
@include button-secondary-outline-icon-hover;
|
|
58
70
|
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
&.is-style-tertiary .wp-block-button__link {
|
|
62
|
-
@include button-tertiary;
|
|
63
71
|
|
|
64
|
-
&:hover,
|
|
65
72
|
&:focus {
|
|
66
|
-
@include button-
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
&.is-style-tertiary-outline .wp-block-button__link {
|
|
71
|
-
@include button-tertiary-outline;
|
|
72
|
-
@include button-tertiary-outline-icon;
|
|
73
|
-
|
|
74
|
-
&:hover,
|
|
75
|
-
&:focus {
|
|
76
|
-
@include button-tertiary-outline-hover;
|
|
77
|
-
@include button-tertiary-outline-icon-hover;
|
|
73
|
+
@include button-secondary-outline-focus;
|
|
78
74
|
}
|
|
79
75
|
}
|
|
80
76
|
|
|
@@ -97,16 +93,6 @@ $_static-icons: settings.$static-icons;
|
|
|
97
93
|
|
|
98
94
|
&.has-icon {
|
|
99
95
|
.wp-block-button__link {
|
|
100
|
-
@include button-icon;
|
|
101
|
-
|
|
102
|
-
&.is-size-small .wp-block-button__link {
|
|
103
|
-
@include button-icon-small;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
&.is-size-large .wp-block-button__link {
|
|
107
|
-
@include button-icon-large;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
96
|
&::after,
|
|
111
97
|
&::before {
|
|
112
98
|
display: block;
|