Skip to content

Commit

Permalink
fix: removed SVGs and update fill style in accordion (microsoft#17527)
Browse files Browse the repository at this point in the history
* removed SVGs to use the default

* Change files

* set the fill color of the icon in style

* using accentFillRestBehavior.var on fill
  • Loading branch information
khamudom authored and joshualamusga1 committed Mar 25, 2021
1 parent 6249ddf commit 25e5dac
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 301 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "removed SVGs to use the default",
"packageName": "@fluentui/web-components",
"email": "khamu@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { css } from '@microsoft/fast-element';
import { display, focusVisible, forcedColorsStylesheetBehavior } from '@microsoft/fast-foundation';
import { SystemColors } from '@microsoft/fast-web-utilities';
import {
accentFillRestBehavior,
neutralDividerRestBehavior,
neutralFocusBehavior,
neutralForegroundActiveBehavior,
Expand Down Expand Up @@ -85,6 +86,7 @@ export const AccordionItemStyles = css`
grid-column: 4;
z-index: 2;
pointer-events: none;
fill: ${accentFillRestBehavior.var};
}
slot[name="collapsed-icon"] {
Expand Down Expand Up @@ -120,6 +122,7 @@ export const AccordionItemStyles = css`
z-index: 2;
}
`.withBehaviors(
accentFillRestBehavior,
neutralDividerRestBehavior,
neutralForegroundActiveBehavior,
neutralForegroundFocusBehavior,
Expand All @@ -132,6 +135,9 @@ export const AccordionItemStyles = css`
border-color: ${SystemColors.Highlight};
box-shadow: 0 0 0 calc((var(--focus-outline-width) - var(--outline-width)) * 1px) ${SystemColors.Highlight};
}
.icon {
fill: ${SystemColors.ButtonText};
}
`,
),
);
301 changes: 0 additions & 301 deletions packages/web-components/src/accordion/fixtures/base.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<fluent-design-system-provider use-defaults>
<style>
.icon {
stroke: var(--accent-fill-rest);
}

fluent-accordion-item.disabled::part(button) {
pointer-events: none;
}
Expand All @@ -19,113 +15,14 @@ <h4>Default</h4>
<button>1</button>
</div>
<span slot="heading">Panel one</span>
<svg
slot="collapsed-icon"
class="icon"
width="18"
height="18"
viewBox="0 0 18 18"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M15.2222 1H2.77778C1.79594 1 1 1.79594 1 2.77778V15.2222C1 16.2041 1.79594 17 2.77778 17H15.2222C16.2041 17 17 16.2041 17 15.2222V2.77778C17 1.79594 16.2041 1 15.2222 1Z"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path d="M9 5.44446V12.5556" stroke-linecap="round" stroke-linejoin="round" />
<path d="M5.44446 9H12.5556" stroke-linecap="round" stroke-linejoin="round" />
</svg>
<svg
slot="expanded-icon"
class="icon"
width="18"
height="18"
viewBox="0 0 18 18"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M15.2222 1H2.77778C1.79594 1 1 1.79594 1 2.77778V15.2222C1 16.2041 1.79594 17 2.77778 17H15.2222C16.2041 17 17 16.2041 17 15.2222V2.77778C17 1.79594 16.2041 1 15.2222 1Z"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path d="M5.44446 9H12.5556" stroke-linecap="round" stroke-linejoin="round" />
</svg>
Panel one content
</fluent-accordion-item>
<fluent-accordion-item>
<span slot="heading">Panel two</span>
<svg
slot="collapsed-icon"
class="icon"
width="18"
height="18"
viewBox="0 0 18 18"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M15.2222 1H2.77778C1.79594 1 1 1.79594 1 2.77778V15.2222C1 16.2041 1.79594 17 2.77778 17H15.2222C16.2041 17 17 16.2041 17 15.2222V2.77778C17 1.79594 16.2041 1 15.2222 1Z"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path d="M9 5.44446V12.5556" stroke-linecap="round" stroke-linejoin="round" />
<path d="M5.44446 9H12.5556" stroke-linecap="round" stroke-linejoin="round" />
</svg>
<svg
slot="expanded-icon"
class="icon"
width="18"
height="18"
viewBox="0 0 18 18"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M15.2222 1H2.77778C1.79594 1 1 1.79594 1 2.77778V15.2222C1 16.2041 1.79594 17 2.77778 17H15.2222C16.2041 17 17 16.2041 17 15.2222V2.77778C17 1.79594 16.2041 1 15.2222 1Z"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path d="M5.44446 9H12.5556" stroke-linecap="round" stroke-linejoin="round" />
</svg>
Panel two content
</fluent-accordion-item>
<fluent-accordion-item expanded>
<span slot="heading">Panel three</span>
<svg
slot="collapsed-icon"
class="icon"
width="18"
height="18"
viewBox="0 0 18 18"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M15.2222 1H2.77778C1.79594 1 1 1.79594 1 2.77778V15.2222C1 16.2041 1.79594 17 2.77778 17H15.2222C16.2041 17 17 16.2041 17 15.2222V2.77778C17 1.79594 16.2041 1 15.2222 1Z"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path d="M9 5.44446V12.5556" stroke-linecap="round" stroke-linejoin="round" />
<path d="M5.44446 9H12.5556" stroke-linecap="round" stroke-linejoin="round" />
</svg>
<svg
slot="expanded-icon"
class="icon"
width="18"
height="18"
viewBox="0 0 18 18"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M15.2222 1H2.77778C1.79594 1 1 1.79594 1 2.77778V15.2222C1 16.2041 1.79594 17 2.77778 17H15.2222C16.2041 17 17 16.2041 17 15.2222V2.77778C17 1.79594 16.2041 1 15.2222 1Z"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path d="M5.44446 9H12.5556" stroke-linecap="round" stroke-linejoin="round" />
</svg>
Panel three content
</fluent-accordion-item>
</fluent-accordion>
Expand All @@ -139,113 +36,14 @@ <h4>Single expand</h4>
<button>1</button>
</div>
<span slot="heading">Panel one</span>
<svg
slot="collapsed-icon"
class="icon"
width="18"
height="18"
viewBox="0 0 18 18"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M15.2222 1H2.77778C1.79594 1 1 1.79594 1 2.77778V15.2222C1 16.2041 1.79594 17 2.77778 17H15.2222C16.2041 17 17 16.2041 17 15.2222V2.77778C17 1.79594 16.2041 1 15.2222 1Z"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path d="M9 5.44446V12.5556" stroke-linecap="round" stroke-linejoin="round" />
<path d="M5.44446 9H12.5556" stroke-linecap="round" stroke-linejoin="round" />
</svg>
<svg
slot="expanded-icon"
class="icon"
width="18"
height="18"
viewBox="0 0 18 18"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M15.2222 1H2.77778C1.79594 1 1 1.79594 1 2.77778V15.2222C1 16.2041 1.79594 17 2.77778 17H15.2222C16.2041 17 17 16.2041 17 15.2222V2.77778C17 1.79594 16.2041 1 15.2222 1Z"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path d="M5.44446 9H12.5556" stroke-linecap="round" stroke-linejoin="round" />
</svg>
Panel one content
</fluent-accordion-item>
<fluent-accordion-item class="disabled">
<span slot="heading">Panel Two</span>
<svg
slot="collapsed-icon"
class="icon"
width="18"
height="18"
viewBox="0 0 18 18"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M15.2222 1H2.77778C1.79594 1 1 1.79594 1 2.77778V15.2222C1 16.2041 1.79594 17 2.77778 17H15.2222C16.2041 17 17 16.2041 17 15.2222V2.77778C17 1.79594 16.2041 1 15.2222 1Z"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path d="M9 5.44446V12.5556" stroke-linecap="round" stroke-linejoin="round" />
<path d="M5.44446 9H12.5556" stroke-linecap="round" stroke-linejoin="round" />
</svg>
<svg
slot="expanded-icon"
class="icon"
width="18"
height="18"
viewBox="0 0 18 18"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M15.2222 1H2.77778C1.79594 1 1 1.79594 1 2.77778V15.2222C1 16.2041 1.79594 17 2.77778 17H15.2222C16.2041 17 17 16.2041 17 15.2222V2.77778C17 1.79594 16.2041 1 15.2222 1Z"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path d="M5.44446 9H12.5556" stroke-linecap="round" stroke-linejoin="round" />
</svg>
Panel two content
</fluent-accordion-item>
<fluent-accordion-item>
<span slot="heading">Panel three</span>
<svg
slot="collapsed-icon"
class="icon"
width="18"
height="18"
viewBox="0 0 18 18"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M15.2222 1H2.77778C1.79594 1 1 1.79594 1 2.77778V15.2222C1 16.2041 1.79594 17 2.77778 17H15.2222C16.2041 17 17 16.2041 17 15.2222V2.77778C17 1.79594 16.2041 1 15.2222 1Z"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path d="M9 5.44446V12.5556" stroke-linecap="round" stroke-linejoin="round" />
<path d="M5.44446 9H12.5556" stroke-linecap="round" stroke-linejoin="round" />
</svg>
<svg
slot="expanded-icon"
class="icon"
width="18"
height="18"
viewBox="0 0 18 18"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M15.2222 1H2.77778C1.79594 1 1 1.79594 1 2.77778V15.2222C1 16.2041 1.79594 17 2.77778 17H15.2222C16.2041 17 17 16.2041 17 15.2222V2.77778C17 1.79594 16.2041 1 15.2222 1Z"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path d="M5.44446 9H12.5556" stroke-linecap="round" stroke-linejoin="round" />
</svg>
Panel three content
</fluent-accordion-item>
</fluent-accordion>
Expand All @@ -259,39 +57,6 @@ <h4>With disabled item</h4>
<button>1</button>
</div>
<span slot="heading">Panel two</span>
<svg
slot="collapsed-icon"
class="icon"
width="18"
height="18"
viewBox="0 0 18 18"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M15.2222 1H2.77778C1.79594 1 1 1.79594 1 2.77778V15.2222C1 16.2041 1.79594 17 2.77778 17H15.2222C16.2041 17 17 16.2041 17 15.2222V2.77778C17 1.79594 16.2041 1 15.2222 1Z"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path d="M9 5.44446V12.5556" stroke-linecap="round" stroke-linejoin="round" />
<path d="M5.44446 9H12.5556" stroke-linecap="round" stroke-linejoin="round" />
</svg>
<svg
slot="expanded-icon"
class="icon"
width="18"
height="18"
viewBox="0 0 18 18"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M15.2222 1H2.77778C1.79594 1 1 1.79594 1 2.77778V15.2222C1 16.2041 1.79594 17 2.77778 17H15.2222C16.2041 17 17 16.2041 17 15.2222V2.77778C17 1.79594 16.2041 1 15.2222 1Z"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path d="M5.44446 9H12.5556" stroke-linecap="round" stroke-linejoin="round" />
</svg>
Panel one content
</fluent-accordion-item>
<fluent-accordion-item class="disabled">
Expand All @@ -302,39 +67,6 @@ <h4>With disabled item</h4>
<button>1</button>
</div>
<span slot="heading">Disabled</span>
<svg
slot="collapsed-icon"
class="icon"
width="18"
height="18"
viewBox="0 0 18 18"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M15.2222 1H2.77778C1.79594 1 1 1.79594 1 2.77778V15.2222C1 16.2041 1.79594 17 2.77778 17H15.2222C16.2041 17 17 16.2041 17 15.2222V2.77778C17 1.79594 16.2041 1 15.2222 1Z"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path d="M9 5.44446V12.5556" stroke-linecap="round" stroke-linejoin="round" />
<path d="M5.44446 9H12.5556" stroke-linecap="round" stroke-linejoin="round" />
</svg>
<svg
slot="expanded-icon"
class="icon"
width="18"
height="18"
viewBox="0 0 18 18"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M15.2222 1H2.77778C1.79594 1 1 1.79594 1 2.77778V15.2222C1 16.2041 1.79594 17 2.77778 17H15.2222C16.2041 17 17 16.2041 17 15.2222V2.77778C17 1.79594 16.2041 1 15.2222 1Z"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path d="M5.44446 9H12.5556" stroke-linecap="round" stroke-linejoin="round" />
</svg>
Disabled content
</fluent-accordion-item>
<fluent-accordion-item expanded>
Expand All @@ -345,39 +77,6 @@ <h4>With disabled item</h4>
<button>1</button>
</div>
<span slot="heading">Panel three</span>
<svg
slot="collapsed-icon"
class="icon"
width="18"
height="18"
viewBox="0 0 18 18"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M15.2222 1H2.77778C1.79594 1 1 1.79594 1 2.77778V15.2222C1 16.2041 1.79594 17 2.77778 17H15.2222C16.2041 17 17 16.2041 17 15.2222V2.77778C17 1.79594 16.2041 1 15.2222 1Z"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path d="M9 5.44446V12.5556" stroke-linecap="round" stroke-linejoin="round" />
<path d="M5.44446 9H12.5556" stroke-linecap="round" stroke-linejoin="round" />
</svg>
<svg
slot="expanded-icon"
class="icon"
width="18"
height="18"
viewBox="0 0 18 18"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M15.2222 1H2.77778C1.79594 1 1 1.79594 1 2.77778V15.2222C1 16.2041 1.79594 17 2.77778 17H15.2222C16.2041 17 17 16.2041 17 15.2222V2.77778C17 1.79594 16.2041 1 15.2222 1Z"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path d="M5.44446 9H12.5556" stroke-linecap="round" stroke-linejoin="round" />
</svg>
Panel three content
</fluent-accordion-item>
</fluent-accordion>
Expand Down

0 comments on commit 25e5dac

Please sign in to comment.