|
1 | | -# postcss-angular-inline |
2 | | -PostCSS syntax for parsing inline CSS of Angular components |
| 1 | +# PostCSS Angular Inline |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +A [PostCSS](https://github.com/postcss/postcss) syntax plugin to process inline CSS styles in Angular components, enabling the use of PostCSS transformations and Stylelint. |
| 6 | + |
| 7 | +**Current Version:** `0.1.0` |
| 8 | + |
| 9 | +## Usage with PostCSS |
| 10 | + |
| 11 | +1. Install via npm: |
| 12 | + |
| 13 | + ```bash |
| 14 | + npm install --save-dev postcss-angular-inline |
| 15 | + ``` |
| 16 | + |
| 17 | +2. Configure PostCSS: |
| 18 | + |
| 19 | + ```javascript |
| 20 | + // postcss.config.js |
| 21 | + module.exports = { |
| 22 | + syntax: "postcss-angular-inline", |
| 23 | + plugins: [ |
| 24 | + // Your PostCSS plugins |
| 25 | + ], |
| 26 | + }; |
| 27 | + ``` |
| 28 | + |
| 29 | +## Usage with Stylelint |
| 30 | + |
| 31 | +To use Stylelint with this syntax plugin and confine linting to only .component.ts files, follow these steps: |
| 32 | + |
| 33 | +1. Install Stylelint and Necessary Plugins |
| 34 | + |
| 35 | + ```bash |
| 36 | + npm install --save-dev stylelint stylelint-config-standard postcss-angular-inline |
| 37 | + ``` |
| 38 | + |
| 39 | +2. Create a .stylelintrc.json Configuration File |
| 40 | + |
| 41 | + ```json |
| 42 | + // .stylelintrc.json |
| 43 | + { |
| 44 | + "extends": ["stylelint-config-standard"], |
| 45 | + "overrides": [ |
| 46 | + { |
| 47 | + "files": ["**/*.component.ts"], |
| 48 | + "customSyntax": "postcss-angular-inline", |
| 49 | + "rules": { |
| 50 | + // Your Stylelint rules |
| 51 | + }, |
| 52 | + }, |
| 53 | + ], |
| 54 | + }; |
| 55 | + ``` |
| 56 | + |
| 57 | +3. Run Stylelint on .component.ts Files |
| 58 | + |
| 59 | + ```bash |
| 60 | + npx stylelint "**/*.component.ts" |
| 61 | + ``` |
| 62 | + |
| 63 | +## Roadmap to Version 1.0.0 |
| 64 | + |
| 65 | +The following features and improvements are planned before the official 1.0.0 release: |
| 66 | + |
| 67 | +1. Better Typing (Target Version: 0.2.0) |
| 68 | + |
| 69 | + - Improve TypeScript definitions for enhanced developer experience and code safety. |
| 70 | + |
| 71 | +2. Testing (Target Version: 0.3.0) |
| 72 | + |
| 73 | + - Enhance the test suite to ensure reliability and prevent regressions. |
| 74 | + |
| 75 | +3. Support for Preprocessors (Target Version: 0.4.0) |
| 76 | + |
| 77 | + - Add support for SCSS and LESS inline styles in Angular components. |
| 78 | + |
| 79 | +4. Handling Empty Strings (Target Version: 0.5.0) |
| 80 | + |
| 81 | + - Fix issues where empty inline styles are not correctly recognized or processed. |
| 82 | + |
| 83 | +5. Preserving Escaped Newlines (Target Version: 0.6.0) |
| 84 | + - Ensure escaped newlines `\n` in strings are preserved and correctly represented in the output. |
| 85 | + |
| 86 | +## Current Limitations |
| 87 | + |
| 88 | +- Escaped newlines (\n) are not preserved, affecting tools like Stylelint. |
| 89 | +- Empty sources may not be handled correctly by Stylelint. |
| 90 | +- Does not support SCSS or LESS in inline styles. |
0 commit comments