Skip to content

Commit fd89b6e

Browse files
committed
Allow using the modifier on SVG and math elements
1 parent 26bf164 commit fd89b6e

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

ember-style-modifier/src/modifiers/style.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function compileStyles(
4444
}
4545

4646
export interface StyleModifierSignature {
47-
Element: HTMLElement;
47+
// TODO: add `Element: ElementCSSInlineStyle & Element` once TypeScript marks `<math>` elements as `MathMLElement`
4848
Args: {
4949
Positional: CSSStyles[];
5050
Named: CSSStyles;

test-app/tests/integration/modifiers/style-test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,18 @@ module('Integration | Modifiers | style', function (hooks) {
6060
assert.dom('p').hasStyle({ fontSize: '6px' });
6161
});
6262

63+
test('it supports usage on SVG elements', async function (assert) {
64+
await render(hbs`<svg {{style display="none"}}></svg>`);
65+
66+
assert.dom('svg').hasStyle({ display: 'none' });
67+
});
68+
69+
test('it supports usage on math elements', async function (assert) {
70+
await render(hbs`<math {{style display="none"}}></math>`);
71+
72+
assert.dom('math').hasStyle({ display: 'none' });
73+
});
74+
6375
{
6476
interface Context extends TestContext {
6577
// eslint-disable-next-line @typescript-eslint/ban-types

0 commit comments

Comments
 (0)