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

fix: fix all the slash warning in scss #697

Merged
merged 1 commit into from
Jul 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions components/ContainerHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ export default {

<style lang="scss" scoped>
$header-top-layer-width: 90%;
$header-top-layer-padding-x: (100% - $header-top-layer-width) / 2;
$header-top-layer-padding-x: math.div(100% - $header-top-layer-width, 2);
$menu-icon-width: 16px;
$logo-wrapper-margin-x: 8px;
$header-search-margin-right: 20px;
Expand Down Expand Up @@ -363,7 +363,7 @@ header {
&::before {
right: calc(
#{$header-top-layer-padding-x} + #{$share-wrapper-width} + #{$header-search-margin-right} +
#{($search-icon-width - $search-field-arrow-width) / 2}
#{math.div($search-icon-width - $search-field-arrow-width, 2)}
);
}
}
Expand Down
8 changes: 4 additions & 4 deletions components/UiArticleGallery.vue
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,10 @@ $aspect-ratio--sm: 1.67;
}

.img-wrapper {
padding-top: $width--img-wrapper / $aspect-ratio;
padding-top: math.div($width--img-wrapper, $aspect-ratio);
margin-right: 20px;
@include media-breakpoint-up(sm) {
padding-top: $width--img-wrapper--sm / $aspect-ratio--sm;
padding-top: math.div($width--img-wrapper--sm, $aspect-ratio--sm);
margin-right: 0;
}
@include media-breakpoint-up(xl) {
Expand Down Expand Up @@ -343,12 +343,12 @@ $padding-top--ad-img: 100%;
}

.latest-list_item_img {
padding-top: $padding-top--ad-img / $aspect-ratio;
padding-top: math.div($padding-top--ad-img, $aspect-ratio);
background-repeat: no-repeat;
background-size: cover;
background-position: center;
@include media-breakpoint-up(sm) {
padding-top: $padding-top--ad-img / $aspect-ratio--sm;
padding-top: math.div($padding-top--ad-img, $aspect-ratio--sm);
}
@include media-breakpoint-up(xl) {
padding-top: 0;
Expand Down
8 changes: 4 additions & 4 deletions components/UiArticleGalleryB.vue
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,11 @@ $aspect-ratio--sm: 1.67;
}

.img-wrapper {
padding-top: $width--img-wrapper / $aspect-ratio;
padding-top: math.div($width--img-wrapper, $aspect-ratio);
margin-right: 20px;

@include media-breakpoint-up(sm) {
padding-top: $width--img-wrapper--sm / $aspect-ratio--sm;
padding-top: math.div($width--img-wrapper--sm, $aspect-ratio--sm);
margin-right: 0;
}
@include media-breakpoint-up(xl) {
Expand Down Expand Up @@ -351,12 +351,12 @@ $padding-top--ad-img: 100%;
}

.latest-list_item_img {
padding-top: $padding-top--ad-img / $aspect-ratio;
padding-top: math.div($padding-top--ad-img, $aspect-ratio);
background-repeat: no-repeat;
background-size: cover;
background-position: center;
@include media-breakpoint-up(sm) {
padding-top: $padding-top--ad-img / $aspect-ratio--sm;
padding-top: math.div($padding-top--ad-img, $aspect-ratio--sm);
}
@include media-breakpoint-up(xl) {
padding-top: 66.7%;
Expand Down
8 changes: 4 additions & 4 deletions components/UiArticleGalleryWithoutFocus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,10 @@ $aspect-ratio--sm: 1.67;
}

.img-wrapper {
padding-top: $width--img-wrapper / $aspect-ratio;
padding-top: math.div($width--img-wrapper, $aspect-ratio);
margin-right: 20px;
@include media-breakpoint-up(sm) {
padding-top: $width--img-wrapper--sm / $aspect-ratio--sm;
padding-top: math.div($width--img-wrapper--sm, $aspect-ratio--sm);
margin-right: 0;
}
@include media-breakpoint-up(xl) {
Expand Down Expand Up @@ -343,12 +343,12 @@ $padding-top--ad-img: 100%;
}

.latest-list_item_img {
padding-top: $padding-top--ad-img / $aspect-ratio;
padding-top: math.div($padding-top--ad-img, $aspect-ratio);
background-repeat: no-repeat;
background-size: cover;
background-position: center;
@include media-breakpoint-up(sm) {
padding-top: $padding-top--ad-img / $aspect-ratio--sm;
padding-top: math.div($padding-top--ad-img, $aspect-ratio--sm);
}
@include media-breakpoint-up(xl) {
padding-top: 0;
Expand Down
4 changes: 2 additions & 2 deletions components/UiFlashNews.vue
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,11 @@ a {

$width--arrow: 10px;
$height--arrow: 5px;
$width-half--arrow: $width--arrow / 2;
$width-half--arrow: math.div($width--arrow, 2);

$width--arrow--md: 13px;
$height--arrow--md: 6px;
$width-half--arrow--md: $width--arrow--md / 2;
$width-half--arrow--md: math.div($width--arrow--md, 2);

&.next::before {
border-width: 0 $width-half--arrow $height--arrow $width-half--arrow;
Expand Down
2 changes: 1 addition & 1 deletion components/UiLoadmoreLoadingIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ $duration: 1.4s;
stroke-dashoffset: $offset;
}
50% {
stroke-dashoffset: ($offset/2);
stroke-dashoffset: (math.div($offset, 2));
transform: rotate(135deg);
}
100% {
Expand Down
11 changes: 6 additions & 5 deletions components/UiSearchBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ export default {

<style lang="scss" scoped>
$header-top-layer-w: 90%;
$header-top-layer-padding-x: (100% - $header-top-layer-w) / 2;
$header-top-layer-padding-x: math.div(100% - $header-top-layer-w, 2);
$search-icon-width: 18px;
$search-field-arrow-width: 11px;
$search-field-arrow-width-half: $search-field-arrow-width / 2;
$search-field-arrow-width-half: math.div($search-field-arrow-width, 2);

.search-bar {
@include media-breakpoint-up(xl) {
Expand Down Expand Up @@ -93,9 +93,10 @@ $search-field-arrow-width-half: $search-field-arrow-width / 2;
position: absolute;
top: -12px;
right: calc(
#{$header-top-layer-padding-x} + #{(
$search-icon-width - $search-field-arrow-width
) / 2}
#{$header-top-layer-padding-x} + #{math.div(
$search-icon-width - $search-field-arrow-width,
2
)}
);
border-color: transparent transparent #064f77;
border-style: solid;
Expand Down
2 changes: 1 addition & 1 deletion components/UiStoryContentHandler.vue
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ export default {
}

&__youtube {
$aspect-ratio--youtube: 315 / 560;
$aspect-ratio--youtube: math.div(315, 560);

.wrapper {
position: relative;
Expand Down
2 changes: 1 addition & 1 deletion components/UiVideoModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default {
</script>

<style lang="scss" scoped>
$aspect-ratio: 9 / 16;
$aspect-ratio: math.div(9, 16);

.video-modal {
position: relative;
Expand Down
2 changes: 1 addition & 1 deletion components/culture-post-for-premium/ContentHandler.vue
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ $quote-color: #4a90e2;
}

.youtube {
$aspect-ratio--youtube: 360 / 640;
$aspect-ratio--youtube: math.div(360, 640);

.wrapper {
position: relative;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export default {

&__img {
@function change-height($key) {
@return change-width($key) / 3 * 2;
@return math.div(change-width($key), 3) * 2;
}
display: block;
align-self: center;
Expand Down
2 changes: 1 addition & 1 deletion components/culture-post/ContentHandler.vue
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ $quote-color: #4a90e2;
}

.youtube {
$aspect-ratio--youtube: 315 / 560;
$aspect-ratio--youtube: math.div(315, 560);

.wrapper {
position: relative;
Expand Down
1 change: 1 addition & 0 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ module.exports = {

styleResources: {
scss: '~/scss/*.scss',
hoistUseStatements: true,
},

apollo: {
Expand Down
2 changes: 1 addition & 1 deletion pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,7 @@ $right--events: 10px;
position: relative;

&--embedded {
padding-top: 9 / 16 * 100%;
padding-top: math.div(9, 16) * 100%;

div {
position: absolute;
Expand Down
1 change: 1 addition & 0 deletions scss/_base.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@use 'sass:math';