Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add script for updating shorthands mappings #546

Merged
merged 2 commits into from
Apr 24, 2024

Conversation

layershifter
Copy link
Member

@layershifter layershifter commented Apr 23, 2024

This PR adds a script that generates packages/core/src/runtime/shorthands.ts. The file will contain a mapping of CSS shorthands to their longhands with priorities. That mapping is need to generate style resets that will remove longhands, see #531.

Copy link

github-actions bot commented Apr 23, 2024

📊 Bundle size report

🤖 This report was generated against 346e7246c24f068e97d115d8f897da825c26820d

@layershifter layershifter force-pushed the feat/shorthands-script branch 2 times, most recently from b83ce8d to 2335b78 Compare April 23, 2024 16:51
@layershifter layershifter marked this pull request as ready for review April 23, 2024 17:02
@layershifter layershifter requested a review from a team as a code owner April 23, 2024 17:02
export function assignShorthandPriority(shorthandProperties: CSSShorthands): CSSShorthands {
const propertiesWithPriority = { ...shorthandProperties };

Object.keys(shorthandProperties)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe assign the default -1 priorities in this function? The fact that the default priorities were assigned in the filter function confused me

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, will redo it.

@layershifter layershifter enabled auto-merge (squash) April 24, 2024 11:46
@layershifter layershifter merged commit 990967b into microsoft:main Apr 24, 2024
4 checks passed
@layershifter layershifter deleted the feat/shorthands-script branch April 24, 2024 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants