Skip to content

Commit

Permalink
fix: apply Focuable styles in class extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
Westbrook Johnson authored and adixon-adobe committed Dec 12, 2019
1 parent 4c266e3 commit 38f7afd
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/link/src/link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import linkStyles from './link.css.js';
*/
export class Link extends Focusable {
public static get styles(): CSSResultArray {
return [linkStyles];
return [...super.styles, linkStyles];
}

@query('#anchor')
Expand Down
2 changes: 1 addition & 1 deletion packages/radio/src/radio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import { Focusable } from '@spectrum-web-components/shared/lib/focusable.js';
*/
export class Radio extends Focusable {
public static get styles(): CSSResultArray {
return [radioStyles];
return [...super.styles, radioStyles];
}
@property({ type: String, reflect: true })
public name = '';
Expand Down
3 changes: 3 additions & 0 deletions packages/shared/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import { Focusable } from '@spectrum-web-components/shared/lib/focusable';
import { html } from 'lit-element';

class FocusableButton extends Focusable {
public static get styles(): CSSResultArray {
return [...super.styles];
}
public get focusElement(): HTMLElement {
/* istanbul ignore if */
if (!this.shadowRoot) {
Expand Down
2 changes: 1 addition & 1 deletion packages/slider/src/slider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const variants = ['color', 'filled', 'ramp', 'range', 'tick'];

export class Slider extends Focusable {
public static get styles(): CSSResultArray {
return [sliderStyles, spectrumSliderStyles];
return [...super.styles, sliderStyles, spectrumSliderStyles];
}

@property()
Expand Down
4 changes: 0 additions & 4 deletions packages/textfield/src/textfield.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ governing permissions and limitations under the License.
vertical-align: top;
}

:host([disabled]) {
pointer-events: none;
}

#input:invalid,
:host([invalid]) #input {
background-image: none;
Expand Down
7 changes: 6 additions & 1 deletion packages/textfield/src/textfield.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ import { nothing } from 'lit-html';

export class Textfield extends Focusable {
public static get styles(): CSSResultArray {
return [textfieldStyles, checkmarkSmallStyles, alertSmallStyles];
return [
...super.styles,
textfieldStyles,
checkmarkSmallStyles,
alertSmallStyles,
];
}

@query('#input')
Expand Down

0 comments on commit 38f7afd

Please sign in to comment.