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

style(list-item): add connotation support for activated list items #833

Merged
merged 33 commits into from
May 26, 2021

Conversation

JoelGraham93
Copy link
Contributor

@jshenkman the text in dark mode for connotation=cta is black in this PR.
The figma file had some white text examples but I thought they might need updating?
https://www.figma.com/file/r8OYLPmRmDqfLKt6KHdJDB/Vonage-UI-Kit---2.0?node-id=4758%3A2725

@github-actions
Copy link

🚀

Latest successful build of the PR deployed here.

🚀

@jshenkman
Copy link
Contributor

@jshenkman the text in dark mode for connotation=cta is black in this PR.
The figma file had some white text examples but I thought they might need updating?
https://www.figma.com/file/r8OYLPmRmDqfLKt6KHdJDB/Vonage-UI-Kit---2.0?node-id=4758%3A2725

Yes, you are right! thanks!
updated the design, so for the light theme the text is white for both primary and CTA, and for the dark theme it's black text for both connotations

Copy link
Contributor

@yinonov yinonov left a comment

Choose a reason for hiding this comment

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

how complex would it be to proxy contextual variants (like shape, connotation) to list itself rather than list item?

components/list/src/vwc-list-item.scss Show resolved Hide resolved
@JoelGraham93
Copy link
Contributor Author

how complex would it be to proxy contextual variants (like shape, connotation) to list itself rather than list item?

We could use a similar approach to the accordion openAll prop that we decided against using:

connectedCallback(): void {
super.connectedCallback();
this.expansionPanels = this.children as HTMLCollectionOf<VWCExpansionPanelBase>;
if (this.multi && this.openAll && this.expansionPanels) {
for (const expansionPanel of this.expansionPanels) {
expansionPanel.open = true;
}
}
}

@yinonov
Copy link
Contributor

yinonov commented May 14, 2021

how complex would it be to proxy contextual variants (like shape, connotation) to list itself rather than list item?

We could use a similar approach to the accordion openAll prop that we decided against using:

connectedCallback(): void {
super.connectedCallback();
this.expansionPanels = this.children as HTMLCollectionOf<VWCExpansionPanelBase>;
if (this.multi && this.openAll && this.expansionPanels) {
for (const expansionPanel of this.expansionPanels) {
expansionPanel.open = true;
}
}
}

how about setting the css values from the list styles. this will prevent any mutations to list items. we practice it in toggle buttons and here

Copy link
Contributor

@yinonov yinonov left a comment

Choose a reason for hiding this comment

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

connotated list items have no ripple indication

@yinonov
Copy link
Contributor

yinonov commented May 20, 2021

how complex would it be to proxy contextual variants (like shape, connotation) to list itself rather than list item?

We could use a similar approach to the accordion openAll prop that we decided against using:

connectedCallback(): void {
super.connectedCallback();
this.expansionPanels = this.children as HTMLCollectionOf<VWCExpansionPanelBase>;
if (this.multi && this.openAll && this.expansionPanels) {
for (const expansionPanel of this.expansionPanels) {
expansionPanel.open = true;
}
}
}

how about setting the css values from the list styles. this will prevent any mutations to list items. we practice it in toggle buttons and here

@JoelGraham93 where does this stand?

@JoelGraham93
Copy link
Contributor Author

@JoelGraham93 where does this stand?

I like this, moving forward with css approach. Just updated the shape implementation

@JoelGraham93 JoelGraham93 requested a review from yinonov May 24, 2021 05:05
@yinonov
Copy link
Contributor

yinonov commented May 24, 2021

@JoelGraham93 where does this stand?

I like this, moving forward with css approach. Just updated the shape implementation

@JoelGraham93 my recommended solution was either to set styles by defining their css variables from the container OR use our API to mutate the child nodes attributes (which might cost in performance in the case of many list items).
We currently practice both approaches in various integrations to apply API to a collective.
in the case here, you defined style props directly and not css variables. this may solve the shape style but isn’t scalable or enables a practice of other APIs (e.g. connotation) that depend on shadowRoot styling and css variables.
If we refactor this and apply desired style by setting attributes to list items we may run into performance issues as mentioned above.
therefore I suggest reverting the changes of shape to only be set by list items alone (as it was before).
Alternately, we have some interesting thoughts on theming coming up… to enable this in a more declarative manner from within the html

@JoelGraham93 JoelGraham93 force-pushed the viv-530-list-item-ripple branch from 1457af4 to 9fbea1b Compare May 25, 2021 01:14
@JoelGraham93
Copy link
Contributor Author

@JoelGraham93 where does this stand?

I like this, moving forward with css approach. Just updated the shape implementation

@JoelGraham93 my recommended solution was either to set styles by defining their css variables from the container OR use our API to mutate the child nodes attributes (which might cost in performance in the case of many list items).
We currently practice both approaches in various integrations to apply API to a collective.
in the case here, you defined style props directly and not css variables. this may solve the shape style but isn’t scalable or enables a practice of other APIs (e.g. connotation) that depend on shadowRoot styling and css variables.
If we refactor this and apply desired style by setting attributes to list items we may run into performance issues as mentioned above.
therefore I suggest reverting the changes of shape to only be set by list items alone (as it was before).
Alternately, we have some interesting thoughts on theming coming up… to enable this in a more declarative manner from within the html

Ok I've reverted and will see how the theming progresses.
I'm not a big fan of encouraging consumers to use css vars unless it's a unique case - with miss-use it could make any rebranding difficult in the future

@yinonov
Copy link
Contributor

yinonov commented May 25, 2021

@JoelGraham93 where does this stand?

I like this, moving forward with css approach. Just updated the shape implementation

@JoelGraham93 my recommended solution was either to set styles by defining their css variables from the container OR use our API to mutate the child nodes attributes (which might cost in performance in the case of many list items).
We currently practice both approaches in various integrations to apply API to a collective.
in the case here, you defined style props directly and not css variables. this may solve the shape style but isn’t scalable or enables a practice of other APIs (e.g. connotation) that depend on shadowRoot styling and css variables.
If we refactor this and apply desired style by setting attributes to list items we may run into performance issues as mentioned above.
therefore I suggest reverting the changes of shape to only be set by list items alone (as it was before).
Alternately, we have some interesting thoughts on theming coming up… to enable this in a more declarative manner from within the html

Ok I've reverted and will see how the theming progresses.
I'm not a big fan of encouraging consumers to use css vars unless it's a unique case - with miss-use it could make any rebranding difficult in the future

Thanks. it was never the intention for consumers to do such overrides. see discussion

Comment on lines 38 to 42
@property({ type: String, reflect: true })
connotation?: ListItemConnotation;

@property({ type: String, reflect: true })
shape?: ListItemShape;
Copy link
Contributor

@yinonov yinonov May 25, 2021

Choose a reason for hiding this comment

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

still relevant? should move back to list-item

Comment on lines 14 to 15
@include color-connotation.connotations-main;
@include color-connotation.connotations-main-default(primary);
Copy link
Contributor

@yinonov yinonov May 25, 2021

Choose a reason for hiding this comment

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

still relevant? should move back to list-item

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I reverted to a commit to remove all this let me check

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yinonov all is correctly reverted now

@JoelGraham93 JoelGraham93 requested a review from yinonov May 25, 2021 10:12
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@yinonov yinonov merged commit 2a2bf11 into master May 26, 2021
@JoelGraham93 JoelGraham93 deleted the viv-530-list-item-ripple branch May 26, 2021 22:59
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.

3 participants