Skip to content

@import -> @use & @forward & meta.load-css #1572

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

Merged
merged 3 commits into from
Jul 18, 2025
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 src/components/pages/Notice.astro
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ for (const notice of noticesWithId) {
</script>

<style lang="scss">
@import "@styles/color.scss";
@use "@styles/color";

.date {
display: inline-block;
width: 6rem;
color: $heading-color;
color: color.$heading-color;
margin-right: 5px;

:where(.date_list).localized & {
Expand Down
10 changes: 5 additions & 5 deletions src/components/pages/mfa/BaseTabSelectorButton.astro
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ function labelProps(selection: Selection) {
</script>

<style lang="scss">
@import "@styles/color.scss";
@use "@styles/color";

$main-color: $heading-color;
$main-color: color.$heading-color;
$sub-color: white;

// buttonのmarginの優先度を上げるため.wrapperが必要
Expand Down Expand Up @@ -140,16 +140,16 @@ function labelProps(selection: Selection) {

button :global(p) {
font-size: 0.9em;
color: $black-gray;
color: color.$black-gray;
margin: 0.5em 0 0;
}

p {
font-weight: bold;
color: $red;
color: color.$red;
margin: 0.2em;
padding: 12px;
border-radius: 5px;
border: 1px solid $red;
border: 1px solid color.$red;
}
</style>
14 changes: 7 additions & 7 deletions src/components/pages/mfa/BaseTabSelectorGrid.astro
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@ function radioProps(step: Step, selection: Selection): DemiRadioButtonProps {
</script>

<style lang="scss">
@import "@styles/color.scss";
@use "@styles/color";

.wrapper {
display: grid;
grid-template-columns: auto 4rem 4rem;
// row-gap: 0.5rem;
border: 1px solid $white-gray-dark;
border: 1px solid color.$white-gray-dark;
margin: 1rem 0;
padding: 0.5rem 0;

Expand Down Expand Up @@ -141,7 +141,7 @@ function radioProps(step: Step, selection: Selection): DemiRadioButtonProps {
p.col-label {
padding: 0.1rem 0.5rem;
font-weight: bold;
background-color: $white-gray-light;
background-color: color.$white-gray-light;
}
p.col-first,
p.col-alt {
Expand All @@ -150,12 +150,12 @@ function radioProps(step: Step, selection: Selection): DemiRadioButtonProps {
span.col-first,
span.col-alt {
position: relative;
background-color: $white-gray-dark;
border-inline-start: 1px solid $white-gray-light;
border-inline-end: 1px solid $white-gray-light;
background-color: color.$white-gray-dark;
border-inline-start: 1px solid color.$white-gray-light;
border-inline-end: 1px solid color.$white-gray-light;

&:has(input[type="radio"]:disabled) {
background-color: $white-gray-light;
background-color: color.$white-gray-light;
}

& > input[type="radio"] {
Expand Down
14 changes: 7 additions & 7 deletions src/components/pages/mfa/BaseTabs.astro
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function panelProps(selection: Selection) {
</script>

<style lang="scss">
@import "@styles/color.scss";
@use "@styles/color";

.tab-list {
display: flex;
Expand All @@ -93,16 +93,16 @@ function panelProps(selection: Selection) {
.panel-list {
padding: 0.5rem;
margin: 0 0 1.5rem;
border: 1px solid $white-gray-light;
border: 1px solid color.$white-gray-light;
}
button.tab {
display: block;
flex: 1;
background-color: $white-gray-dark;
background-color: color.$white-gray-dark;
padding: 0.75rem 0.5rem;
border-width: 0 0.5px;
border-style: solid;
border-color: $white-gray-light;
border-color: color.$white-gray-light;
outline: none;
box-shadow: none;

Expand All @@ -111,9 +111,9 @@ function panelProps(selection: Selection) {
}

&[aria-selected="true"] {
color: $heading-color;
background-color: $white-gray-light;
border-bottom: 4px solid $heading-color;
color: color.$heading-color;
background-color: color.$white-gray-light;
border-bottom: 4px solid color.$heading-color;
font-weight: bold;
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/components/pages/mfa/DemiRadioButton.astro
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ export interface Props
<span class="button-inner"></span>

<style lang="scss">
@import "@styles/color.scss";
@use "@styles/color";

span.button-outer {
position: absolute;
border: 2px solid $black-gray;
border: 2px solid color.$black-gray;
border-radius: 50%;
width: 1.2rem;
height: 1.2rem;
Expand All @@ -30,16 +30,16 @@ export interface Props

span.button-inner {
position: absolute;
border: 2px solid $white-gray-light;
background-color: $white-gray-light;
border: 2px solid color.$white-gray-light;
background-color: color.$white-gray-light;
border-radius: 50%;
width: 0.8rem;
height: 0.8rem;
inset: 0;
margin: auto !important;

input:checked ~ & {
background-color: $black-gray;
background-color: color.$black-gray;
}

input:disabled ~ & {
Expand Down
12 changes: 6 additions & 6 deletions src/layouts/Footer/Buttons.astro
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const supportUrl = {
</div>

<style lang="scss">
@import "@styles/color.scss";
@use "@styles/color";
.wrap {
position: fixed;
right: 0;
Expand Down Expand Up @@ -107,7 +107,7 @@ const supportUrl = {

&:hover {
color: #fff;
background-color: $body-link-color;
background-color: color.$body-link-color;
}
}

Expand All @@ -131,7 +131,7 @@ const supportUrl = {
transition: all 0.2s ease-in-out;

@media not all and (max-width: 768px) {
background-color: $footer-background-color;
background-color: color.$footer-background-color;
margin: 0 auto;

width: 3rem;
Expand Down Expand Up @@ -167,7 +167,7 @@ const supportUrl = {

@media not all and (max-width: 768px) {
margin-top: 0.375rem;
color: $footer-background-color;
color: color.$footer-background-color;
font-size: 0.75rem;
}

Expand All @@ -180,11 +180,11 @@ const supportUrl = {
@media not all and (max-width: 768px) {
&:hover {
.icon {
background-color: $body-link-color;
background-color: color.$body-link-color;
}

.description {
color: $body-link-color;
color: color.$body-link-color;
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/layouts/Footer/SocialLinks.astro
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ const socialMediaPolicy: {
</div>

<style lang="scss">
@import "../../styles/color.scss";
@use "@styles/color";

div.social-links {
background: $white-gray-light;
border-bottom: 5px solid $heading-color;
background: color.$white-gray-light;
border-bottom: 5px solid color.$heading-color;

padding: 0.5rem 4rem 0.5rem;
@media (max-width: 768px) {
Expand Down Expand Up @@ -114,7 +114,7 @@ const socialMediaPolicy: {
align-items: center;
& > a {
text-decoration: none;
color: $footer-background-color;
color: color.$footer-background-color;
&:hover {
text-decoration: underline;
}
Expand Down
4 changes: 2 additions & 2 deletions src/layouts/Footer/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ const topUrl = {
</footer>

<style lang="scss">
@import "../../styles/color.scss";
@use "@styles/color";
div.footer {
background-color: $footer-background-color;
background-color: color.$footer-background-color;
color: white;
padding: 2rem 4rem 8rem;
:link,
Expand Down
22 changes: 11 additions & 11 deletions src/layouts/Header/Navigation.astro
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ const data: Navigation[] = {
</nav>

<style lang="scss">
@import "../../styles/color";
@import "./variables";
@use "@styles/color";
@use "variables";

nav.header {
grid-row: 2 / 3;
Expand All @@ -52,7 +52,7 @@ const data: Navigation[] = {
text-decoration: none;
}

@media not all and (max-width: $header-hamburger-breakpoint) {
@media not all and (max-width: variables.$header-hamburger-breakpoint) {
& > ul {
display: flex;
margin: 0;
Expand Down Expand Up @@ -90,7 +90,7 @@ const data: Navigation[] = {
transform: translateX(-50%);
margin: 0 auto;
padding: 0;
background: $header-nav-bg-color;
background: color.$header-nav-bg-color;
transition: all 0.1875s ease;
& > li {
display: block;
Expand All @@ -100,7 +100,7 @@ const data: Navigation[] = {
display: block;
padding: 0.5rem 0;
&:hover {
background: $header-nav-bg-color-dark;
background: color.$header-nav-bg-color-dark;
}
}
}
Expand Down Expand Up @@ -136,30 +136,30 @@ const data: Navigation[] = {
}
}

@media (max-width: $header-hamburger-breakpoint) {
@media (max-width: variables.$header-hamburger-breakpoint) {
& > ul {
display: block;
margin: 0;
padding: 0;
border-bottom: 1px solid $white-gray-dark;
background: $header-nav-bg-color;
border-bottom: 1px solid color.$white-gray-dark;
background: color.$header-nav-bg-color;
& > li {
display: block;
& > div {
padding: 0.5em 1em;
border-top: 1px solid $white-gray-dark;
border-top: 1px solid color.$white-gray-dark;
}
& > ul {
display: block;
padding: 0;
& > li {
display: block;
border-top: 1px solid $gray;
border-top: 1px solid color.$gray;
& > a {
display: block;
padding: 0.5em 1em 0.5em 2em;
&:hover {
background: $header-nav-bg-color-dark;
background: color.$header-nav-bg-color-dark;
}
}
}
Expand Down
Loading