Skip to content

Instantly share code, notes, and snippets.

View simonwhatley's full-sized avatar

Simon Whatley simonwhatley

View GitHub Profile
@colinrotherham
colinrotherham / _autocomplete.scss
Last active November 21, 2018 10:15
GOV.UK Accessible Autocomplete Sass
.autocomplete__wrapper {
position: relative;
}
.autocomplete__hint,
.autocomplete__input {
-webkit-appearance: none;
border: 2px solid;
border-radius: 0; /* Safari 10 on iOS adds implicit border rounding. */
box-sizing: border-box;
router.get('/section-1*', function(req, res, next){
res.locals['serviceName'] = foo
next()
})
@edwardhorsford
edwardhorsford / filters.js
Last active October 28, 2022 13:55
Useful Nunjucks filters for the GOV.UK Prototype Kit
/*
=====================================================================
arrayToGovukTable
Convert an array to form needed for govukTable macro
=====================================================================
Expects array or nested array.
Usage:
@benjystanton
benjystanton / accessible-interactive-maps-draft.md
Last active November 30, 2020 08:25
Accessible interactive maps (draft)
@adamsilver
adamsilver / Validator.js
Last active August 6, 2020 14:33
Server side form validator component for Express
function Validator(req, res) {
this.req = req;
this.res = res;
this.validators = [];
this.errors = [];
}
Validator.prototype.add = function(name, rules) {
this.validators.push({
name: name,
@alextea
alextea / accessible-autocomplete-prototype-kit.md
Last active December 7, 2022 17:03
This is a step by step guide on how to use the accessible autocomplete component in the GOV.UK prototype kit

Using accessible autocomplete in the GOV.UK prototype kit

This is a step by step guide on how to use the accessible autocomplete component in the GOV.UK prototype kit. There aren’t any instructions included with the code for using with the prototype kit, and it’s not straightforward if you’re not familiar with javascript.

I have an example repo you can download to check the code.

Download

Download the accessible autocomplete code, you can download the zip or clone the repo if you prefer to use git.

Copy the files to your prototype

Copy the minified files from the /dist folder to your prototype.