convertPairToCSSText

说明

将给定的CSS样式键值对转化为cssText字符串

源码

用法

convertPairToCSSText.test.ts
1
import { convertPairToCSSText } from "../../utility/dom/convertPairToCSSText";
2
3
describe('convertPairToCSSText', () => {
4
test('convertPairToCSSText should extract CSS pair object into truthy cssText.', () => {
5
const origin: Partial<CSSStyleDeclaration> = {
6
border: '1px dotted red',
7
backgroundColor: 'blue',
8
};
9
const expected = `border: 1px dotted red; background-color: blue; `;
10
11
expect(convertPairToCSSText(origin)).toBe(expected);
12
});
13
});
Copied!
最近更新 1yr ago
复制链接