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

Remove innerHTML property #10

Closed
wants to merge 66 commits into from
Closed

Remove innerHTML property #10

wants to merge 66 commits into from

Conversation

dziku86
Copy link

@dziku86 dziku86 commented Nov 22, 2020

Because innerHTML is potentially a security risk remove it from the code.

Here is simplest way to handle focus style that i can think of:

JS:

document.addEventListener('mousedown', () => { body.dataset.focus = '' })
document.addEventListener('keydown', e => { if (e.key === 'Tab') delete body.dataset.focus })

CSS:

body[data-focus] :focus {
  outline: 0;
}

body:not([data-focus]) :focus {
  outline: rgba(0, 125, 250, .6) solid 2px;
}

Benefits:

  • doesn't create <style> element
  • no css in js
  • less code

lindsayevans and others added 30 commits September 28, 2018 10:19
* src, lib, examples
* Making main lib/index.js
* Adding build task to copy JS etc.
* Outputting to ESM, CJS & UMD
* Only determine cssText support on init
* Check if css has changed before setting it
* Removing -moz prefix
@dziku86 dziku86 closed this Apr 28, 2021
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.

None yet

2 participants