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: Allow autocomplete to be styled from parent #124

Merged
merged 5 commits into from
Mar 23, 2022
Merged

Conversation

DafyddLlyr
Copy link
Contributor

This PR allows certain properties of the address-autocomplete component to be styled from a parent. The properties that have been given variables should marry up with any that we need to match the PlanX style.

Lit Docs - https://lit.dev/docs/components/styles/#theming

Example with Lambeth primary colour

image

To Do

  • Document these new properties with more than just a comment in the code

@netlify
Copy link

netlify bot commented Mar 23, 2022

Deploy Preview for oslmap ready!

Name Link
🔨 Latest commit 002185b
🔍 Latest deploy log https://app.netlify.com/sites/oslmap/deploys/623b474b2ffef80009da7b77
😎 Deploy Preview https://deploy-preview-124--oslmap.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@DafyddLlyr DafyddLlyr requested a review from a team March 23, 2022 13:11
Copy link
Member

@jessicamcinchak jessicamcinchak left a comment

Choose a reason for hiding this comment

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

thank you, this is great! one minor suggestion, but excited to try this in planx asap 🚀

id="${this.id}-container"
role="status"
spellcheck="false"
></div>`;
Copy link
Member

Choose a reason for hiding this comment

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

👍 thanks for catching these extra props!

@@ -1,6 +1,46 @@
@import "node_modules/govuk-frontend/govuk/all";
// @import "accessible-autocomplete";

:host {
$font-size: var(--autocomplete__input__font-size, 19px);
$input-height: var(--autocomplete__input__height, 35px);
Copy link
Member

Choose a reason for hiding this comment

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

maybe option to pass $font-family here too? i think this could default to "GDS Transport", arial, sans-serif" as it renders now, but we'll probably want it to inherit Inter in planx? (otherwise i think it would become the new stray rounded-corners that would really haunt alastair lol 🙃)

i have a weird little hack below for the ul, li elements you should feel free to remove too - i realize that font does not actually match the autocomplete label currently!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! ⚾

--autocomplete__option__hover-border-color: pink;
--autocomplete__option__hover-background-color: pink;
}
</style> -->
Copy link
Member

Choose a reason for hiding this comment

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

cool to see theming in action, this all works smoothly for me locally 🌺

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.

2 participants