2023-03-14 13:18:55 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) HashiCorp, Inc.
|
2023-08-11 13:12:13 +00:00
|
|
|
* SPDX-License-Identifier: BUSL-1.1
|
2023-03-14 13:18:55 +00:00
|
|
|
*/
|
|
|
|
|
2022-01-27 11:27:38 +00:00
|
|
|
import Modifier from 'ember-modifier';
|
|
|
|
import { inject as service } from '@ember/service';
|
|
|
|
|
|
|
|
export default class CSSPropModifier extends Modifier {
|
|
|
|
@service('-document') doc;
|
|
|
|
didReceiveArguments() {
|
|
|
|
const params = this.args.positional;
|
|
|
|
const options = this.args.named;
|
|
|
|
const returns = params[1] || options.returns;
|
|
|
|
returns(this.doc.defaultView.getComputedStyle(this.element).getPropertyValue(params[0]));
|
|
|
|
}
|
|
|
|
}
|