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

[shoreline-css] Generate javascript object from css variables #1771

Open
matheusps opened this issue Jul 30, 2024 · 1 comment
Open

[shoreline-css] Generate javascript object from css variables #1771

matheusps opened this issue Jul 30, 2024 · 1 comment
Labels
dev Indicates that the issue or pull request involves engineering considerations proposal Proposals for enhancements to the software

Comments

@matheusps
Copy link
Contributor

Problem

We have multiple files to manage the same theme: tokens.css and preset.ts. The css file is the actual theme, preset is only used for the documentation site.

The main problem of the current solution is having two sources of truth for theming - creating the necessity of changing both for a successful theme change.

Solution

Generate the javascript version from css tokens. For example, the css code:

@theme sunrise {
  :root {
    --color-blue: #0000FF
  }
}

Becomes:

export default {
  colorBlue: '#0000FF'
}

Usage examples

No response

Dependencies

No response

References

@matheusps matheusps added the proposal Proposals for enhancements to the software label Jul 30, 2024
@matheusps matheusps changed the title [shoreline-css] [shoreline-css] Generate javascript object from css variables Jul 30, 2024
@matheusps matheusps moved this to Backlog in Shoreline Jul 30, 2024
@matheusps matheusps added the dev Indicates that the issue or pull request involves engineering considerations label Jul 30, 2024
@matheusps
Copy link
Contributor Author

#1765

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev Indicates that the issue or pull request involves engineering considerations proposal Proposals for enhancements to the software
Projects
Status: Backlog
Development

No branches or pull requests

1 participant