Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ core/list ] 古いリストカラー設定に対応しました #2188

Merged
merged 12 commits into from
Aug 26, 2024
6 changes: 3 additions & 3 deletions inc/vk-blocks/extensions/core/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function vk_blocks_render_core_list( $block_content, $block ) {
'selector' => ".is-style-vk-numbered-square-mark.{$unique_classname} li::before",
'declarations' => array(
'color' => '#fff',
'background-color' => vk_blocks_get_color_code( $block['attrs']['color'] ),
'background-color' => vk_blocks_get_color_code( $block['attrs']['color'] ) . ' !important',
),
),
);
Expand All @@ -59,7 +59,7 @@ function vk_blocks_render_core_list( $block_content, $block ) {
'selector' => ".is-style-vk-numbered-circle-mark.{$unique_classname} li::before",
'declarations' => array(
'color' => '#fff',
'background-color' => vk_blocks_get_color_code( $block['attrs']['color'] ),
'background-color' => vk_blocks_get_color_code( $block['attrs']['color'] ) . ' !important',
),
),
);
Expand All @@ -68,7 +68,7 @@ function vk_blocks_render_core_list( $block_content, $block ) {
array(
'selector' => ".{$unique_classname} li::marker,.{$unique_classname} li::before",
'declarations' => array(
'color' => vk_blocks_get_color_code( $block['attrs']['color'] ),
'color' => vk_blocks_get_color_code( $block['attrs']['color'] ) . ' !important',
),
),
);
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ e.g.
== Changelog ==

[ Add Setting ][ Alert ] Add icon setting and inner block.
[ Bug fix ] [ Core List ] Add support for handling list color in old settings.
[ Bug fix ][ Tab Item ] When duplicating an active tab-item block, no more than one tab-item block becomes active.

= 1.82.0 =
Expand Down
27 changes: 18 additions & 9 deletions src/utils/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@ ol {
&-vk-numbered-circle-mark,
&-vk-numbered-square-mark {
padding-inline-start: 2em;
&:not(.has-text-color),
&:not(.has-link-color) {
color: initial;
}
li {
list-style: none;
position: relative;
Expand Down Expand Up @@ -375,7 +379,8 @@ ol {
}

@each $colorClass, $color in $colorPalette {
&.#{$colorClass} {
&.vk-has-#{$colorClass}-color,
&.has-vk-#{$colorClass}-color {
li::marker {
color: $color;
}
Expand All @@ -384,13 +389,17 @@ ol {
}
}

&.is-style-vk-numbered-circle-mark.#{$colorClass}-color,
&.is-style-vk-numbered-square-mark.#{$colorClass}-color {
li::before {
color: #ffffff;
background-color: $color;
&.is-style-vk-numbered-circle-mark,
&.is-style-vk-numbered-square-mark {
&.vk-has-#{$colorClass}-color,
&.has-vk-#{$colorClass}-color {
li::before {
color: #fff;
background-color: $color;
}
}
}

}
}
//ul,ol
Expand Down Expand Up @@ -609,8 +618,8 @@ ol {
/*-------------------------------------------*/
$xxl-min: 1400px;
.col {
// Bootstrap4 では xxl サイズがないので独自に追加
@media (min-width: $xxl-min) {
// Bootstrap4 では xxl サイズがないので独自に追加
@media (min-width: $xxl-min) {
&-xxl-2 {
flex: 0 0 16.66667%;
max-width: 16.66667%;
Expand Down Expand Up @@ -639,7 +648,7 @@ $xxl-min: 1400px;
/*-------------------------------------------*/
.wp-block-columns {
&.wp-block-columns.is-vk-row-reverse {
flex-direction: row-reverse;
flex-direction: row-reverse;
}
}

Expand Down
Loading