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

Support custom style factory #98

Merged
merged 8 commits into from
Apr 9, 2022
Merged

Support custom style factory #98

merged 8 commits into from
Apr 9, 2022

Conversation

sgratzl
Copy link
Member

@sgratzl sgratzl commented Feb 20, 2022

closes #97 by allowing creating of alternative style tags. This can also be used to e.g don't have an inline style tag but manage it within the document body.

@sgratzl sgratzl added the enhancement New feature or request label Feb 20, 2022
@sgratzl sgratzl self-assigned this Feb 20, 2022
@sgratzl
Copy link
Member Author

sgratzl commented Feb 20, 2022

open issue: how to handle it with the bundle / vue to support that

@sgratzl
Copy link
Member Author

sgratzl commented Feb 21, 2022

open issue: how to handle it with the bundle / vue to support that

created an createElement function within the bundle that is wrapping Preact's createElement. Thus, you can write createElement the old way:

import {createElement} from "@upsetjs/bundle";

function customStyleFactory(rules: string) {
  return createElement(
    'style',
    {
      extra: 'abc',
    },
    rules
  );
}

@sgratzl sgratzl merged commit 3d69b70 into develop Apr 9, 2022
@sgratzl sgratzl deleted the sgratzl/style-tag-factory branch April 9, 2022 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant