Skip to content

feat: Allow autocomplete to be styled from parent#124

Merged
DafyddLlyr merged 5 commits intomainfrom
dp/dynamic-style
Mar 23, 2022
Merged

feat: Allow autocomplete to be styled from parent#124
DafyddLlyr merged 5 commits intomainfrom
dp/dynamic-style

Conversation

@DafyddLlyr
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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!


:host {
$font-size: var(--autocomplete__input__font-size, 19px);
$input-height: var(--autocomplete__input__height, 35px);
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch! ⚾

Comment thread index.html
--autocomplete__option__hover-border-color: pink;
--autocomplete__option__hover-background-color: pink;
}
</style> -->
Copy link
Copy Markdown
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