feat: Add modern XD format support and pixel-perfect design analysis tools - #1
Open
achilleleduc wants to merge 1 commit into
Open
feat: Add modern XD format support and pixel-perfect design analysis tools#1achilleleduc wants to merge 1 commit into
achilleleduc wants to merge 1 commit into
Conversation
…tools Major Enhancements: - Support both legacy (v1.x) and modern (v2.33+) XD file formats - Add 8 new pixel-perfect design analysis tools - Enhance parser to handle per-artboard graphicContent.agc files - Update color parsing for new RGB value format (0-255 range) New Tools: 1. analyze_layout_spacing - Detect spacing patterns and generate tokens 2. generate_design_tokens - Export complete design systems (CSS/Tailwind/TS) 3. detect_ui_patterns - Identify buttons, cards, inputs automatically 4. extract_typography_system - Organize all text styles 5. detect_layout_system - Suggest flexbox/grid CSS 6. get_element_styles - Export CSS and Tailwind classes 7. get_artboard_details - Detailed artboard information 8. export_artboard_preview - View designs in terminal Technical Improvements: - Backward compatible with old XD format - Enhanced XDParser with dual-format support - New DesignSystemAnalyzer for token generation - Comprehensive test suite (test-features.ts) - Updated documentation and examples Version: 2.0.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds comprehensive pixel-perfect design analysis capabilities and extends the XD parser to support modern XD file formats (v2.33+).
Problem Solved
The original parser only supported legacy XD file format (single
artwork.agcfile). Modern Adobe XD (v2.33+) uses a different structure with per-artboardgraphicContent.agcfiles, causing the parser to fail with "Invalid XD file: no artwork found" error.Major Enhancements
1. Modern XD Format Support ✨
2. Eight New Pixel-Perfect Design Analysis Tools 🎯
analyze_layout_spacing- Detect spacing patterns and generate spacing tokensgenerate_design_tokens- Export complete design systems in CSS/Tailwind/TypeScript/JSONdetect_ui_patterns- Automatically identify buttons, cards, inputs with confidence scoresextract_typography_system- Organize all text styles with semantic namingdetect_layout_system- Suggest flexbox/grid CSS from layout patternsget_element_styles- Export detailed CSS and Tailwind classes for elementsget_artboard_details- Get comprehensive artboard informationexport_artboard_preview- View design previews in terminalTechnical Improvements
DesignSystemAnalyzerclass for design token generationXDParserwith dual-format support viaparseNewFormat()test-features.ts) for all 11 toolsFiles Changed
src/parsers/xd-parser.ts- Added modern format parsingsrc/tools/xd-tools.ts- Added 8 new analysis toolssrc/analyzers/design-system-analyzer.ts- New design system analyzersrc/test-features.ts- Comprehensive test suitesrc/index.ts- Registered new toolsREADME.md- Updated documentationpackage.json- Version 2.0.0Testing
Tested with:
Breaking Changes
None - fully backward compatible with existing code.
Example Usage
Would love to contribute this back to help others working with modern XD files! Let me know if you'd like any changes.