数通智联化工云平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 lines
989 B

2 years ago
'use strict';
const uniteSets = require('../utils/uniteSets.js');
const lengthUnits = new Set([
// Font-relative length units
'cap',
'ch',
'em',
'ex',
'ic',
'lh',
'rcap',
'rch',
'rem',
'rex',
'ric',
'rlh',
// Viewport-percentage lengths
'dvb',
'dvh',
'dvi',
'dvmax',
'dvmin',
'dvw',
'lvb',
'lvh',
'lvi',
'lvmax',
'lvmin',
'lvw',
'svb',
'svh',
'svi',
'svmax',
'svmin',
'svw',
'vb',
'vh',
'vi',
'vw',
'vmin',
'vmax',
'vm',
// Absolute length units
'px',
'mm',
'cm',
'in',
'pt',
'pc',
'q',
'mozmm',
// Flexible length units
'fr',
// Container query units
'cqw',
'cqh',
'cqi',
'cqb',
'cqmin',
'cqmax',
]);
2 years ago
const resolutionUnits = new Set(['dpi', 'dpcm', 'dppx', 'x']);
const units = uniteSets(lengthUnits, resolutionUnits, [
2 years ago
// Relative length units
'%',
// Time length units
's',
'ms',
// Angle
'deg',
'grad',
'turn',
'rad',
// Frequency
'Hz',
'kHz',
]);
module.exports = {
lengthUnits,
2 years ago
resolutionUnits,
2 years ago
units,
};