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: add SlotStylesMixin for injecting styles #2445

Merged
merged 6 commits into from
Sep 6, 2021

Conversation

web-padawan
Copy link
Member

Description

I was hoping to avoid this but looks like this is the way to go. Based on the prototype.
There will be a follow-up PR which uses this mixin to add styles to vaadin-number-field e.g. like this:

  get slotStyles() {
    return {
      ...super.slotStyles,
      number: `
        /* Hide the native arrow icons */
        input[type="number"]::-webkit-outer-spin-button,
        input[type="number"]::-webkit-inner-spin-button {
          -webkit-appearance: none;
          margin: 0;
        }
        input[type="number"] {
          -moz-appearance: textfield;
        }
      `
    };
  }

Note, this could be used by some components like vaadin-tab to cover cases like the one mentioned in #872

<vaadin-tab>
  <a href="/employee-list">
    <vaadin-icon icon="vaadin:list"></vaadin-icon>
    <span>Employee list</span>
  </a>
</vaadin-tab>

Part of #2436

Type of change

  • Feature

@web-padawan web-padawan added a11y Accessibility issue a11y phase 1 First batch of accessibility fixes labels Sep 3, 2021
@web-padawan web-padawan force-pushed the feat/slot-styles-mixin branch 2 times, most recently from 8b32e6c to 86975f5 Compare September 3, 2021 09:30
@sonarcloud
Copy link

sonarcloud bot commented Sep 6, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

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

No Coverage information No Coverage information
0.0% 0.0% Duplication

@web-padawan web-padawan merged commit bd6ea70 into master Sep 6, 2021
@web-padawan web-padawan deleted the feat/slot-styles-mixin branch September 6, 2021 10:21
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with platform 22.0.0.alpha3 and is also targeting the upcoming stable 22.0.0 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants