|
| 1 | +# @ciolabs/html-mso-properties |
| 2 | + |
| 3 | +> Microsoft Office CSS properties |
| 4 | +
|
| 5 | +A comprehensive TypeScript package containing all Microsoft Office (MSO) CSS properties, their valid values, defaults, and inheritance behavior. |
| 6 | + |
| 7 | +## Install |
| 8 | + |
| 9 | +```bash |
| 10 | +npm install @ciolabs/html-mso-properties |
| 11 | +``` |
| 12 | + |
| 13 | +## Usage |
| 14 | + |
| 15 | +### Import the data |
| 16 | + |
| 17 | +```typescript |
| 18 | +import msoProperties from '@ciolabs/html-mso-properties'; |
| 19 | + |
| 20 | +// Get all MSO properties |
| 21 | +console.log(msoProperties.length); // 1000+ properties |
| 22 | + |
| 23 | +// Find a specific property |
| 24 | +const borderAlt = msoProperties.find(prop => prop.property === 'mso-border-alt'); |
| 25 | +console.log(borderAlt); |
| 26 | +// { |
| 27 | +// property: 'mso-border-alt', |
| 28 | +// values: ['apples', 'arched-scallops', 'auto', ...], |
| 29 | +// default: null, |
| 30 | +// inherits: false |
| 31 | +// } |
| 32 | +``` |
| 33 | + |
| 34 | +### Import the types |
| 35 | + |
| 36 | +```typescript |
| 37 | +import { MsoProperty } from '@ciolabs/html-mso-properties'; |
| 38 | + |
| 39 | +function processProperty(prop: MsoProperty) { |
| 40 | + console.log(`Property: ${prop.property}`); |
| 41 | + console.log(`Valid values: ${prop.values.join(', ')}`); |
| 42 | + console.log(`Default: ${prop.default}`); |
| 43 | + console.log(`Inherits: ${prop.inherits}`); |
| 44 | +} |
| 45 | +``` |
| 46 | + |
| 47 | +## Data Structure |
| 48 | + |
| 49 | +The package exports an array of `MsoProperty` objects. Each object contains: |
| 50 | + |
| 51 | +- **`property`** (`string`) - Name of the CSS property (e.g., `'mso-border-alt'`) |
| 52 | +- **`values`** (`string[]`) - Array of valid values for the property |
| 53 | +- **`default`** (`string | number | null`) - The default value, or `null` if no default |
| 54 | +- **`inherits`** (`boolean`) - Whether the property value is inherited from parent elements |
| 55 | + |
| 56 | +## TypeScript Support |
| 57 | + |
| 58 | +This package includes full TypeScript support with exported interfaces: |
| 59 | + |
| 60 | +```typescript |
| 61 | +export interface MsoProperty { |
| 62 | + property: string; |
| 63 | + values: string[]; |
| 64 | + default: string | number | null; |
| 65 | + inherits: boolean; |
| 66 | +} |
| 67 | +``` |
0 commit comments