8000 chore: clean-up · coreui/coreui-utils@a22d623 · GitHub
[go: up one dir, main page]

Skip to content

Commit a22d623

Browse files
committed
chore: clean-up
1 parent cf45676 commit a22d623

File tree

2 files changed

+7
-57
lines changed

2 files changed

+7
-57
lines changed

src/get-css-custom-properties.ts

Lines changed: 0 additions & 42 deletions
This file was deleted.

src/get-style.ts

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,12 @@
1-
import getCssCustomProperties from './get-css-custom-properties'
2-
3-
const minIEVersion = 11
4-
const isIE1x = () => Boolean(document.DOCUMENT_NODE) && document.DOCUMENT_NODE >= minIEVersion
5-
const isCustomProperty = (property: string) => property.match(/^--.*/i)
1+
/**
2+
* --------------------------------------------------------------------------
3+
* CoreUI (__COREUI_VERSION__): get-style.ts
4+
* Licensed under MIT (https://github.com/coreui/coreui-utils/blob/master/LICENSE)
5+
* --------------------------------------------------------------------------
6+
*/
67

78
const getStyle = (property: string, element = document.body) => {
8-
let style
9-
10-
if (isCustomProperty(property) && isIE1x()) {
11-
const cssCustomProperties = getCssCustomProperties()
12-
style = cssCustomProperties[property]
13-
} else {
14-
style = window.getComputedStyle(element, null).getPropertyValue(property).replace(/^\s/, '')
15-
}
16-
17-
return style
9+
return window.getComputedStyle(element, null).getPropertyValue(property).replace(/^\s/, '')
1810
}
1911

2012
export default getStyle

0 commit comments

Comments
 (0)
0