Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:vektor-inc/vk-blocks-pro into fi…
Browse files Browse the repository at this point in the history
…x/tab-labels-margin
  • Loading branch information
drill-lancer committed Dec 23, 2024
2 parents 6f498fb + 6e3d48d commit 81c0a0e
Show file tree
Hide file tree
Showing 14 changed files with 1,002 additions and 50 deletions.
3 changes: 3 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ e.g.

== Changelog ==
[ Design Bug Fix ][ Tab (Pro) ] Added a CSS class to improve style priority with the Lightning theme.
[ Design Bug Fix ][ Core List ][ Border Box ] Improved handling of List's is-style-default style and Border Box color.

[ Specification change ][ Outer (Pro) ] Removed the aria-label attribute from links, and updated to exclude target and rel attributes when they are empty.

= 1.93.0 =
[ Add function ][ Link toolbar ][ Outer (Pro) ] Added settings for "rel" and link description.
Expand Down
1 change: 1 addition & 0 deletions src/blocks/_pro/outer/deprecated/hooks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import OuterHook1_0_13 from './1.0.13/'
// saveの数分必要
export default [
// 後方互換
OuterHook1_60_0, // 1.93.0
OuterHook1_60_0, // 1.92.1
OuterHook1_60_0, // 1.89.0
OuterHook1_60_0, // 1.76.0
Expand Down
103 changes: 103 additions & 0 deletions src/blocks/_pro/outer/deprecated/save/1.93.0/GenerateBgImage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
const GenerateBgImage = (props) => {
const { attributes, prefix } = props;
const { bgImageMobile, bgImageTablet, bgImage, bgSize, blockId } =
attributes;

const mobileViewport = 'max-width: 575.98px';
const tabletViewport = 'min-width: 576px';
const pcViewport = 'min-width: 992px';
const underPcViewport = 'max-width: 992.98px';

let backgroundStyle;
const backgroundPosition = 'background-position:center!important;';
if ('cover' === bgSize) {
backgroundStyle = `background-size:${bgSize}!important; ${backgroundPosition}`;
} else if ('repeat' === bgSize) {
backgroundStyle = `background-repeat:${bgSize}!important; background-size: auto; ${backgroundPosition}`;
} else {
backgroundStyle = ``;
}

//moible only
if (bgImageMobile && !bgImageTablet && !bgImage) {
return (
<style>{`.${prefix}-${blockId}{background-image: url(${bgImageMobile}); ${backgroundStyle}}`}</style>
);
}
//tablet only
if (!bgImageMobile && bgImageTablet && !bgImage) {
return (
<style>{`.${prefix}-${blockId}{background-image: url(${bgImageTablet}); ${backgroundStyle}}`}</style>
);
}
//pc only
if (!bgImageMobile && !bgImageTablet && bgImage) {
return (
<style>{`.${prefix}-${blockId}{background-image: url(${bgImage}); ${backgroundStyle}}`}</style>
);
}
//pc -mobile
if (bgImageMobile && !bgImageTablet && bgImage) {
return (
<style>
{`
@media screen and (${underPcViewport}) {
.${prefix}-${blockId}{background-image: url(${bgImageMobile}); ${backgroundStyle}}
}
@media screen and (${pcViewport}) {
.${prefix}-${blockId}{background-image: url(${bgImage}); ${backgroundStyle}}
}
`}
</style>
);
}
//pc -tablet
if (!bgImageMobile && bgImageTablet && bgImage) {
return (
<style>
{`
@media screen and (${underPcViewport}) {
.${prefix}-${blockId}{background-image: url(${bgImageTablet}); ${backgroundStyle}}
}
@media screen and (${pcViewport}) {
.${prefix}-${blockId}{background-image: url(${bgImage}); ${backgroundStyle}}
}
`}
</style>
);
}
//tablet - mobile
if (bgImageMobile && bgImageTablet && !bgImage) {
return (
<style>
{`
@media screen and (${mobileViewport}) {
.${prefix}-${blockId}{background-image: url(${bgImageMobile}); ${backgroundStyle}}
}
@media screen and (${tabletViewport}) {
.${prefix}-${blockId}{background-image: url(${bgImageTablet}); ${backgroundStyle}}
}
`}
</style>
);
}
//pc -tablet - mobile
if (bgImageMobile && bgImageTablet && bgImage) {
return (
<style>
{`
@media screen and (${mobileViewport}) {
.${prefix}-${blockId}{background-image: url(${bgImageMobile}); ${backgroundStyle}}
}
@media screen and (${tabletViewport}) {
.${prefix}-${blockId}{background-image: url(${bgImageTablet}); ${backgroundStyle}}
}
@media screen and (${pcViewport}) {
.${prefix}-${blockId}{background-image: url(${bgImage}); ${backgroundStyle}}
}
`}
</style>
);
}
};
export default GenerateBgImage;
Loading

0 comments on commit 81c0a0e

Please sign in to comment.