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

Feat: styles #81

Merged
merged 1 commit into from
Nov 11, 2021
Merged

Feat: styles #81

merged 1 commit into from
Nov 11, 2021

Conversation

mhevery
Copy link
Contributor

@mhevery mhevery commented Nov 11, 2021

No description provided.

styleImport.then((styles: string) => {
const style = document.createElement('style');
style.setAttribute('q:style', styleId);
style.textContent = styles.replace(/�/g, styleId);
Copy link
Contributor

Choose a reason for hiding this comment

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

What is /�/g?

@@ -304,14 +304,18 @@ describe('q-render', () => {
expectRendered(
<hello-world
on:q-render={HelloWorld.onRender}
q:style={HelloWorld.styles as any}
q:sstyle={HelloWorld_styles}
Copy link
Contributor

Choose a reason for hiding this comment

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

is q:sstyle correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Scoped Style. Not loving it, but for now until we figure out something better.

@@ -40,7 +40,12 @@ export const enum AttributeMarker {
/**
* Component Styles.
*/
ComponentStyles = 'q:style',
ComponentStyles = 'q:sstyle',
Copy link
Contributor

Choose a reason for hiding this comment

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

Ok guess it's correct, but why the change from q:style to q:sstyle?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So we can have both scoped and unscoped styles.

@mhevery mhevery merged commit 8b7f6ea into main Nov 11, 2021
@mhevery mhevery deleted the pr-mhevery-styles branch November 11, 2021 22:58
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.

None yet

2 participants