Skip to content

Commit

Permalink
Merge pull request #1375 from vektor-inc/fix/button/background-clear
Browse files Browse the repository at this point in the history
[ ボタン ]背景色をクリアしたとき、primary に変換
  • Loading branch information
mthaichi authored Aug 18, 2022
2 parents 99f70e6 + c52a2b9 commit 6a71917
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ e.g.

[ Improvement ][ Page list from ancestor ] Fix behavior site editor.
[ Bug Fix ][ highlighter ] cope with color palette with alpha.
[ Bug Fix ][ button ] buttonColorCustom clear convert to primary.

= 1.41.1 =
[ Bug Fix ] Fix don't display Admin screen in case of spacific option value
Expand Down
3 changes: 3 additions & 0 deletions src/blocks/button/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ export default function ButtonEdit(props) {
useEffect(() => {
if (buttonColorCustom !== undefined) {
updateBlockAttributes(clientId, { buttonColor: 'custom' });
} else if (buttonColor === 'custom') {
// 背景色クリアされたらデフォルトに戻す
updateBlockAttributes(clientId, { buttonColor: 'primary' });
}
}, [buttonColorCustom]);

Expand Down
7 changes: 5 additions & 2 deletions src/blocks/button/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ $xxl-min: 1400px;

:root,
:root .editor-styles-wrapper {
.has-vk-color-primary-background-color {
.has-vk-color-primary-background-color,
.has-undefined-background-color {
background-color: var(--vk-color-primary);
}
.has-vk-color-secondary-background-color {
Expand Down Expand Up @@ -367,6 +368,8 @@ $xxl-min: 1400px;
user-select: text;
text-decoration: none;
font-size: calc( var(--vk-size-text) * 1 );


}
&.btn-lg{
font-size:calc( var(--vk-size-text) * 1.25 );
Expand Down Expand Up @@ -403,4 +406,4 @@ $xxl-min: 1400px;
// Font Awesomeアイコンが管理画面側で改行されないために inline-block を指定
display: inline-block;
}
}
}

0 comments on commit 6a71917

Please sign in to comment.