openfga / frontend-utils

Helpful functions for building OpenFGA model authoring frontends - https://www.npmjs.com/package/@openfga/frontend-utils
https://openfga.dev
Apache License 2.0
15 stars 8 forks source link

Enhance Highlighting Customization for `OpenFgaDsl` Language #244

Closed Siddhant-K-code closed 2 months ago

Siddhant-K-code commented 3 months ago

Description

This PR aims to enhance the customization of syntax highlighting for the OpenFgaDsl language definition.

Changes:

This change will make it easier for users to customize the highlighting colors without needing to add the OpenFGA specific CSS. It provides a more seamless integration with the default PrismJS themes and improves the overall DevX when working with OpenFgaDsl code.

Why this approach?

In this, each token in the languageDefinition object has been given a more descriptive name that aligns with the default PrismJS tokens. The alias property is used to maintain the mapping to the original OpenFgaDslThemeTokenType enum values.

This approach allows for easier customization of the highlighting colors by utilizing the default PrismJS tokens, while still keeping the internal mapping to the specific OpenFgaDslThemeTokenType enum values.

References

fixes #177

Review Checklist