1 | import window from '../window';
|
2 |
|
3 | let styfn = {};
|
4 |
|
5 |
|
6 | styfn.getEmSizeInPixels = function(){
|
7 | let px = this.containerCss( 'font-size' );
|
8 |
|
9 | if( px != null ){
|
10 | return parseFloat( px );
|
11 | } else {
|
12 | return 1;
|
13 | }
|
14 | };
|
15 |
|
16 |
|
17 | styfn.containerCss = function( propName ){
|
18 | let cy = this._private.cy;
|
19 | let domElement = cy.container();
|
20 |
|
21 | if( window && domElement && window.getComputedStyle ){
|
22 | return window.getComputedStyle( domElement ).getPropertyValue( propName );
|
23 | }
|
24 | };
|
25 |
|
26 | export default styfn;
|