Typescript中有CSS接口吗?我想定义我的接口,这将扩展它。像这样的东西:
export interface IComponentProperties extends ICSS {
title: string,
text?: string,
resizable?: boolean,
connectToParent?: string | HTMLElement,
replaceParentContent?: boolean,
}
如果没有任何css接口,我的接口应该是这样的:
export interface IComponentProperties{
// CSS props
width?: string,
height?: string,
backgroundColor?: string,
display?: string,
position?: string,
left?: string,
right?: string,
transition?: string,
"z-index"?: string,
"flex-direction"?: string,
// Component props
title: string,
text?: string,
resizable?: boolean,
connectToParent?: string | HTMLElement,
replaceParentContent?: boolean,
}
并且我必须在那里指定我最终将使用的每个css属性。。。那么有没有CSS接口,我可以扩展?
谢啦!
存在
null
const { style } = document.createElement('div');
console.log(style.height, typeof style.height, style.height.length);