Skip to content

Commit

Permalink
fix(loading-spinner, sidenav, docs): use is-on-background correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
daneah committed Jan 4, 2024
1 parent f8342cc commit 315bb4d
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions packages/pharos-site/static/guidelines/button.docs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,8 @@ import ellipsesExample from '@images/components/button/buttons_ellipses-example.
<PageSection title="Buttons on dark background" subSectionLevel={1}>
<p>
When a button is used on a darker background (e.g., black or marble-gray-20), use the
on-background attribute. The four variants described above can all be used on dark backgrounds
and follow the same guidelines.
is-on-background attribute. The four variants described above can all be used on dark
backgrounds and follow the same guidelines.
</p>
<div
style={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
align-items: center;
}

:host(:not([on-background])) .loading-spinner__wrapper {
:host(:not([is-on-background])) .loading-spinner__wrapper {
background-color: rgb(255 255 255 / 0.8);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ focusable="false"
export class PharosLoadingSpinner extends PharosElement {
/**
* Indicates if the spinner is on background
* @attr on-background
* @attr is-on-background
*/
@property({ type: Boolean, reflect: true, attribute: 'on-background' })
public onBackground = false;
@property({ type: Boolean, reflect: true, attribute: 'is-on-background' })
public isOnBackground = false;

/**
* Indicates if the spinner is small
Expand Down Expand Up @@ -111,7 +111,7 @@ export class PharosLoadingSpinner extends PharosElement {
{ stroke: PharosLoadingSpinnerColorStrokeOnBackground, offset: 0.9 },
{ stroke: PharosLoadingSpinnerColorStrokeOnBackground, offset: 1 },
];
const colorKeys = this.onBackground ? colorKeysOnBackground : colorKeysBase;
const colorKeys = this.isOnBackground ? colorKeysOnBackground : colorKeysBase;
const colorTiming: KeyframeAnimationOptions = {
easing: 'ease-in-out',
duration: 6000,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const OnBackground = {
render: () =>
html`
<div style="height: 5rem; width: 5rem; background: black; position: relative;">
<storybook-pharos-loading-spinner on-background></storybook-pharos-loading-spinner>
<storybook-pharos-loading-spinner is-on-background></storybook-pharos-loading-spinner>
</div>
`,
};
Expand All @@ -57,7 +57,7 @@ export const SmallOnBackground = {
render: () =>
html`
<div style="height: 5rem; width: 5rem; background: black; position: relative;">
<storybook-pharos-loading-spinner small on-background></storybook-pharos-loading-spinner>
<storybook-pharos-loading-spinner small is-on-background></storybook-pharos-loading-spinner>
</div>
`,
};
4 changes: 2 additions & 2 deletions packages/pharos/src/components/sidenav/pharos-sidenav.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ describe('pharos-sidenav', () => {
name="my-input-group"
placeholder="Search"
hide-label
on-background
is-on-background
>
<span slot="label">Search</span>
<test-pharos-button
name="search-button"
icon="search"
variant="subtle"
a11y-label="search"
on-background
is-on-background
></test-pharos-button>
</test-pharos-input-group>
<test-pharos-sidenav-section show-divider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const Base = {
icon="search"
variant="subtle"
a11y-label="search"
on-background
is-on-background
></storybook-pharos-button>
</storybook-pharos-input-group>
<storybook-pharos-sidenav-section show-divider>
Expand Down

0 comments on commit 315bb4d

Please sign in to comment.