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

web-twig: Whitelist of allowed HTML attributes for each component #18

Open
literat opened this issue Apr 22, 2024 · 0 comments
Open

web-twig: Whitelist of allowed HTML attributes for each component #18

literat opened this issue Apr 22, 2024 · 0 comments

Comments

@literat
Copy link
Contributor

literat commented Apr 22, 2024

WHEN (situation): as a developer,
WHAT: I want to be able to specify all the HTML attributes that apply to the component,
WHY: so I don't have to edit the component with every unknown attribute

Acceptance criteria
each component accepts all valid HTML attributes that are bound to the HTML tag
Implementation notes (optional)
can be inspired by the types in typescript, where such lists already exist
a set of constants is created

https://www.notion.so/almacareer/Twig-HTML-atributy-de7b63bdc992477394a93155d4449642

Each Twig component has its own list of allowed HTML attributes that can be passed to it. If you need to pass it an attribute that is not allowed in the implementation, you must explicitly allow it.
The - list of allowed attributes expands on demand.

→ Blocking for the product that Spirit is using. Developers must look for a temporary solution to deal with the absence of an attribute.

+ The component is in complete control of the attributes it accepts.

→ Prevention from XSS, etc.

Some components do not mention in the documentation which attributes they override in the element (e.g. TextArea and autocomplete attribute).
- Component implementation is a black-box for many DS users. They don't know which HTML attributes can be passed to elements. Explicit mention in the documentation would encourage proper use of the component and make its behavior more transparent.

GitHub: lmc-eu/spirit-design-system#957 (review)

Jira: https://jira.lmc.cz/browse/DS-836

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

No branches or pull requests

1 participant