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

refactor(ffe-accordion): fjerner obrukt css og fikser styleint advarsel #2105

Merged
merged 1 commit into from
Jun 21, 2024
Merged
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
59 changes: 17 additions & 42 deletions packages/ffe-accordion/less/accordion.less
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
}

.ffe-accordion-item {
--icon-color: var(--ffe-v-accordion-primary-color);
--icon-border-color: var(--ffe-v-accordion-primary-color);
--icon-background-color: var(--ffe-v-accordion-secondary-color);

margin-bottom: var(--ffe-spacing-xs);
transition: margin-bottom var(--ffe-transition-duration)
var(--ffe-ease-in-out-back);
Expand All @@ -17,13 +21,10 @@
border: 2px solid transparent;
background-color: var(--ffe-v-accordion-secondary-color);

&__heading {
margin: 0;
}

&__heading,
&__body {
overflow-wrap: anywhere;
margin: 0;
}

&__heading-button {
Expand All @@ -38,17 +39,8 @@

@media (hover: hover) and (pointer: fine) {
&:hover {
.ffe-accordion-item__heading-icon {
transition: fill var(--ffe-transition-duration)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Denen kan ikke ha funket. .... fill var fra svg sin tid, men byttet til color og hoper det gjør noe men vansklig og se med blotta øgat. :)

var(--ffe-ease);
color: var(--ffe-v-accordion-secondary-color);
}

.ffe-accordion-item__heading-icon-wrapper {
transition: background-color var(--ffe-transition-duration)
var(--ffe-ease);
background-color: var(--ffe-v-accordion-primary-color);
}
--icon-color: var(--ffe-v-accordion-secondary-color);
--icon-background-color: var(--ffe-v-accordion-primary-color);
}
}

Expand All @@ -68,16 +60,21 @@

&__heading-icon-wrapper {
line-height: 0;
border: 1px solid var(--ffe-v-accordion-primary-color);
border: 1px solid var(--icon-border-color);
border-radius: 50%;
padding: var(--ffe-spacing-xs);
background: var(--icon-background-color);
transition: background-color var(--ffe-transition-duration)
var(--ffe-ease);
}

&__heading-icon {
&__heading-icon.ffe-icons {
display: block;
flex: 0 0 auto;
color: var(--ffe-v-accordion-primary-color);
transition: transform var(--ffe-transition-duration)
var(--ffe-ease-in-out-back);
color: var(--icon-color);
transition:
transform var(--ffe-transition-duration) var(--ffe-ease-in-out-back),
color var(--ffe-transition-duration) var(--ffe-ease);
}

&__body {
Expand All @@ -100,25 +97,3 @@
border-color: var(--ffe-v-accordion-focus-border-color);
}
}

.native & {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dom her grejerna ordner ju theme.less

@media (prefers-color-scheme: dark) {
.ffe-accordion-item {
&__heading-icon {
color: var(--ffe-v-accordion-primary-color);
}

@media (hover: hover) and (pointer: fine) {
&:hover {
.ffe-accordion-item__heading-icon {
color: var(--ffe-v-accordion-secondary-color);
}

.ffe-accordion-item__heading-icon-wrapper {
background-color: var(--ffe-v-accordion-primary-color);
}
}
}
}
}
}
Loading