0
Fork 0
mirror of https://github.com/penpot/penpot-export.git synced 2025-01-07 15:39:00 -05:00
Commit graph

67 commits

Author SHA1 Message Date
Roberto Redradix
ee2531f6c6 chore(cli)!: avoid non-obvious CSS class names clashing errors
As observed in fa873130, current classname PoC tranformation is prone to name clashing errors because it replaces everything not matching `/[a-zA-Z_-|0-9]/g` with underscores. However, as names from typography assets coming from Penpot can hold these values (and often they will, because designers consider emoji useful specially in asset names), the tranformation needed a more thorough algorhythm to avoid clashing errors.

This implementation follows the CSS specification and browser behaviours, which allow more than those characters in class names (including non-ASCII Unicode characters, and even escaped ASCII characters that CSS uses in its syntax), to output valid CSS class nameswith a minimum surface of clashing possibilities.

Since any transformation will decrease the entropy because CSS syntax is a subset of Unicode, there are inevitable clash zones, though. Those zones are reduced to two easily observable cases: duplicated names with explicit underscores instead of spaces, and duplicated names with surrounding whitespace; e.g. "My typography", "My_typography", " My typography" or "My typography " will clash if any pair of those ever happen together.

BREAKING CHANGE: class names generation is no longer case insensitive.
2023-08-29 17:23:04 +02:00
Roberto Redradix
d0e18709f1 chore(demo): demonstrate typography CSS working in a web document 2023-08-29 17:23:04 +02:00
Roberto Redradix
c201db2f2d chore(demo): generate typographies CSS 2023-08-29 17:23:04 +02:00
Roberto Redradix
61ec971192 chore(cli): temporarily avoid conflicting normalized typography names 2023-08-29 17:23:04 +02:00
Roberto Redradix
e19ea35b84 feat: allow exporting typographies CSS 2023-08-29 17:23:04 +02:00
Roberto Redradix
028e29f4c0 chore(cli): avoid creating a static array instance for base config
The `pages` property is overwritten at `validateAndNormalizePenpotExportConfig` to avoid an infinite loop. Remove that possibility altogether.
2023-08-22 17:50:00 +02:00
Roberto Redradix
218e01636f feat(cli): show a meaninfull error for Penpot API error responses 2023-08-22 17:11:54 +02:00
Roberto Redradix
1754228058 style(cli): format code base 2023-08-22 13:54:58 +02:00
Roberto Redradix
aa2b97c571 build(cli): set up code formatter 2023-08-22 13:54:53 +02:00
Roberto Redradix
712ae191e7 build(cli): use a valid license in package.json 2023-08-22 13:54:35 +02:00
Roberto Redradix
878d18dcb2 chore(demo): update Penpot file id 2023-08-22 13:54:25 +02:00
Roberto Redradix
1edea394de chore(demo): fix config type annonation 2023-08-22 13:54:09 +02:00
Roberto Redradix
e42be8ea53 build(workspace): fix demo npm script 2023-08-22 13:53:51 +02:00
Enrique Bernabeu
d8a4b33d2b Enhanced documentation 2023-08-21 08:43:42 +02:00
Enrique Bernabeu
efa9daee67 Add yarn workspaces link 2023-08-21 08:41:36 +02:00
Enrique Bernabeu
49dd395dc8 Moved types 2023-08-21 08:40:26 +02:00
Enrique Bernabeu
9eed1481ce Initial commit 2023-08-21 08:36:47 +02:00