Skip to content

Commit

Permalink
Merge pull request #844 from L4Ph/sass-migrator
Browse files Browse the repository at this point in the history
SCSSから`@import`を廃止する
  • Loading branch information
yoichiro authored Jun 9, 2024
2 parents 7c7691e + eaf5de5 commit 69fe1f1
Show file tree
Hide file tree
Showing 68 changed files with 281 additions and 279 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"redux-devtools-extension": "^2.13.8",
"redux-thunk": "^2.3.0",
"reinvented-color-wheel": "^0.2.10",
"sass": "^1.49.8",
"sass": "^1.77.4",
"tss-react": "^3.3.1",
"typescript": "^5.4.5",
"web-vitals": "^1.1.0"
Expand Down
3 changes: 2 additions & 1 deletion src/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@use 'sass:map';
:root {
--header-height: 42px;
--key-height: 56px;
Expand Down Expand Up @@ -43,7 +44,7 @@ $breakpoints: (
'xl': 'screen and (min-width: 1001px)',
) !default;
@mixin mq($breakpoint: md) {
@media #{map-get($breakpoints, $breakpoint)} {
@media #{map.get($breakpoints, $breakpoint)} {
@content;
}
}
6 changes: 3 additions & 3 deletions src/components/catalog/content/Content.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../variables';
@use '../../../variables';
.catalog-content {
display: flex;
position: relative;
Expand Down Expand Up @@ -29,14 +29,14 @@
flex-direction: column;
align-items: center;
justify-content: center;
padding-top: $space-xl;
padding-top: variables.$space-xl;
background-color: white;
flex: 1 1;
width: 100%;
height: 100vh;
}

@include mq(sm) {
@include variables.mq(sm) {
.catalog-content {
padding-top: calc(var(--key-height));
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/catalog/header/Header.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../_variables.scss';
@use '../../../_variables.scss';

.catalog-header {
display: flex;
Expand All @@ -8,7 +8,7 @@
flex-direction: row;
align-items: center;
margin: 0;
padding: 0 $space-m;
padding: 0 variables.$space-m;
background: white;
border-bottom: 1px solid rgba(0, 0, 0, 0.2);
z-index: 2;
Expand Down
4 changes: 2 additions & 2 deletions src/components/catalog/keyboard/CatalogKeyboard.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../variables';
@use '../../../variables';

.catalog-keyboard {
&-wrapper {
Expand Down Expand Up @@ -30,7 +30,7 @@
width: 100%;
}

@include mq(sm) {
@include variables.mq(sm) {
&-header {
padding: 8px;
}
Expand Down
10 changes: 5 additions & 5 deletions src/components/catalog/keyboard/CatalogKeyboardHeader.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../variables';
@use '../../../variables';

.catalog-keyboard-header {
color: white;
Expand All @@ -16,7 +16,7 @@
flex-direction: row;
width: 100%;
padding: 16px 16px 16px 8px;
background-color: $primary;
background-color: variables.$primary;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
Expand All @@ -43,7 +43,7 @@
& h6 {
font-size: 0.9rem;
}
@include mq(lg) {
@include variables.mq(lg) {
& h1 {
font-size: 24px;
font-weight: bold;
Expand Down Expand Up @@ -72,7 +72,7 @@
&-stores {
margin-left: 16px;
}
@include mq(lg) {
@include variables.mq(lg) {
&-github {
margin-left: 8px;
div {
Expand All @@ -99,7 +99,7 @@
}
}

@include mq(sm) {
@include variables.mq(sm) {
.catalog-keyboard-header {
margin-top: 0;
margin-bottom: 8px;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../../variables';
@use '../../../../variables';

.build-parameters-dialog {
&-content {
Expand Down
2 changes: 1 addition & 1 deletion src/components/catalog/keyboard/build/CatalogBuild.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import 'src/variables';
@use '../../../../variables';

.catalog-build {
&-container {
Expand Down
4 changes: 2 additions & 2 deletions src/components/catalog/keyboard/firmware/CatalogFirmware.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import 'src/variables';
@use '../../../../variables';

.catalog-firmware {
&-wrapper {
Expand Down Expand Up @@ -32,7 +32,7 @@

&-total-download-count {
width: 100%;
margin-bottom: $space-m;
margin-bottom: variables.$space-m;
}

&-card {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import 'src/variables';
@use '../../../../variables';

.catalog-introduction {
&-wrapper {
Expand All @@ -19,7 +19,7 @@
margin-bottom: 32px;
}

@include mq(sm) {
@include variables.mq(sm) {
&-container {
padding-top: 0;
}
Expand All @@ -45,7 +45,7 @@
width: 438px;
align-items: center;
}
@include mq(lg) {
@include variables.mq(lg) {
.image-gallery-slides {
width: 100%;
}
Expand All @@ -57,11 +57,11 @@
&.active,
&:focus {
outline: none;
border: 2px solid $primary;
border: 2px solid variables.$primary;
}
}

@include mq(lg) {
@include variables.mq(lg) {
.image-gallery-thumbnail {
width: 80px;
}
Expand All @@ -72,13 +72,13 @@
flex-direction: column;
justify-content: center;
align-items: center;
color: $color-gray-600;
color: variables.$color-gray-600;
width: 438px;
height: 328px;
background-color: $color-gray-300;
background-color: variables.$color-gray-300;
}
}
@include mq(sm) {
@include variables.mq(sm) {
&-image {
padding: 0;
&-nothing {
Expand Down Expand Up @@ -131,7 +131,7 @@
cursor: pointer;

&:hover {
border: 1px solid $color-gray-300;
border: 1px solid variables.$color-gray-300;
}

&-image {
Expand All @@ -145,13 +145,13 @@
&-no-image {
width: 100px;
height: 75px;
border: 1px dotted $color-gray-300;
border: 1px dotted variables.$color-gray-300;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
color: $color-gray-600;
background-color: $color-gray-300;
color: variables.$color-gray-600;
background-color: variables.$color-gray-300;
font-size: 0.8rem;
}

Expand Down
4 changes: 2 additions & 2 deletions src/components/catalog/keyboard/keymap/CatalogKeymap.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import 'src/variables';
@use '../../../../variables';

.catalog-keymap {
&-container {
Expand Down Expand Up @@ -85,7 +85,7 @@
justify-content: center;
align-items: center;
flex-wrap: wrap;
padding: $space-l $space-l 0 $space-l;
padding: variables.$space-l variables.$space-l 0 variables.$space-l;
z-index: 2;
}

Expand Down
4 changes: 2 additions & 2 deletions src/components/catalog/keyboard/keymap/CatalogKeymapList.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import 'src/variables';
@use '../../../../variables';

.catalog-keymap-list {
&-wrapper {
Expand All @@ -12,6 +12,6 @@
}

&-row-selected {
background-color: $primary !important;
background-color: variables.$primary !important;
}
}
8 changes: 4 additions & 4 deletions src/components/catalog/search/CatalogSearch.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../variables';
@use '../../../variables';

.catalog-search-wrapper {
position: relative;
Expand Down Expand Up @@ -107,8 +107,8 @@
flex-direction: column;
justify-content: center;
align-items: center;
color: $color-gray-600;
background-color: $color-gray-300;
color: variables.$color-gray-600;
background-color: variables.$color-gray-300;
}

&-content {
Expand Down Expand Up @@ -167,7 +167,7 @@
}
}

@include mq(sm) {
@include variables.mq(sm) {
.catalog-search-result-card {
flex-direction: column;
height: 210px;
Expand Down
2 changes: 1 addition & 1 deletion src/components/catalog/search/CatalogSearchForm.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../variables';
@use '../../../variables';
.catalog-search-condition-container {
display: flex;
flex-direction: column;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../variables';
@use '../../../variables';

.anchor-typography {
&-link {
Expand Down
6 changes: 3 additions & 3 deletions src/components/common/auth/AuthProviderDialog.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import 'src/variables';
@use '../../../variables';

.auth-provider-dialog {
.close-dialog {
Expand All @@ -7,7 +7,7 @@
right: 20px;

&:hover {
color: $primary-light;
color: variables.$primary-light;
cursor: pointer;
}
}
Expand All @@ -18,7 +18,7 @@

&-provider {
display: inline-block;
margin-left: $space-m;
margin-left: variables.$space-m;
}
}
}
2 changes: 1 addition & 1 deletion src/components/common/auth/ProfileIcon.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import 'src/variables';
@use '../../../variables';

.profile-icon {
&-avatar {
Expand Down
4 changes: 2 additions & 2 deletions src/components/common/firmware/FlashFirmwareDialog.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../variables';
@use '../../../variables';

.flash-firmware-dialog {
&-info {
Expand Down Expand Up @@ -26,7 +26,7 @@
justify-content: center;
margin: 8px;
padding: 8px;
border: 1px solid $color-gray-300;
border: 1px solid variables.$color-gray-300;

&-items {
display: flex;
Expand Down
4 changes: 2 additions & 2 deletions src/components/common/firmware/UploadFirmwareDialog.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../variables';
@use '../../../variables';

.upload-firmware-dialog {
&-upload-file-form {
Expand All @@ -24,7 +24,7 @@
}

&-message {
color: $color-gray-500;
color: variables.$color-gray-500;
}
}
}
Loading

0 comments on commit 69fe1f1

Please sign in to comment.