-
Notifications
You must be signed in to change notification settings - Fork 149
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
Make Accessible Autocomplete a GOV.UK Prototype Kit plugin #598
base: main
Are you sure you want to change the base?
Changes from all commits
41e9b71
525ceb6
8d841d6
07bc751
380b4a8
a91f4cf
e4b560b
0923a5d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"meta": { | ||
"description": "A component that helps users choose the right answer from a list as they type. It also helps you get more accurate and consistent answers from users.", | ||
"urls": { | ||
"releaseNotes": "https://github.com/alphagov/accessible-autocomplete/releases/tag/v{{version}}", | ||
"documentation": "https://github.com/alphagov/accessible-autocomplete#readme", | ||
"versionHistory": "https://github.com/alphagov/accessible-autocomplete/releases" | ||
} | ||
}, | ||
"assets": [ | ||
"/dist", | ||
"/dist/accessible-autocomplete.min.js.map" | ||
], | ||
"scripts": [ | ||
"/dist/accessible-autocomplete.min.js" | ||
], | ||
"stylesheets": [ | ||
"/dist/accessible-autocomplete.min.css" | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -152,6 +152,15 @@ | |
font-weight: 400; | ||
} | ||
|
||
/* Try font "GDS Transport" for GOV.UK form groups */ | ||
.govuk-form-group .autocomplete__hint, | ||
.govuk-form-group .autocomplete__input, | ||
.govuk-form-group .autocomplete__option { | ||
font-family: "GDS Transport", arial, sans-serif; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
} | ||
Comment on lines
+155
to
+162
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To add to what @romaricpascal was saying: This could instead be part of a separate That way autocomplete users can choose from:
Also wanted to mention: the historic reason for why the autocomplete doesn't use GOVUK Frontend classes is because it precedes v0.1 of GOVUK Frontend. It's also a nice feature which has allowed it to be adopted in places outside Gov such as FT or Wordpress. So yes, keeping the "Default styling" agnostic is still worth doing. 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm wondering if this might work:
|
||
|
||
.autocomplete__hint, | ||
.autocomplete__option { | ||
padding: 5px; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think relying on the class is a bit fragile, but if thats the approach I would suggest calling it out, something like:
Because if they use examples from elsewhere, it won't have it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it could get a mention here too?
https://github.com/alphagov/accessible-autocomplete?tab=readme-ov-file#styling-the-autocomplete