If you try to use a <details> tag without markup suggested on govuk-elements, details.polyfill.js throws the following error in the console:
details.polyfill.js:94 Uncaught TypeError: Cannot read property 'id' of null
at addDetailsPolyfill (details.polyfill.js:94)
As the HTML markup is technically not invalid, I would say that it is incorrect to throw a hard error just because you're using markup that differs to the recommended example. Perhaps a softer warning that you're not using the recommended markup is more appropriate.
If you try to use a
<details>
tag without markup suggested on govuk-elements, details.polyfill.js throws the following error in the console:As the HTML markup is technically not invalid, I would say that it is incorrect to throw a hard error just because you're using markup that differs to the recommended example. Perhaps a softer warning that you're not using the recommended markup is more appropriate.