autoComplete.js icon indicating copy to clipboard operation
autoComplete.js copied to clipboard

Have the ability to use another tag than "mark" for highlight of matched characters

Open williamdes opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe. I would like to not use "mark" as it has bootstrap classes and use another tag like "b"

Please Describe alternatives you've considered Override the bootstrap CSS

Additional context Refactoring at https://github.com/code-lts/doctum

PS: this lib is great !

williamdes avatar Jan 02 '22 21:01 williamdes

This is the only CSS for mark added by bootstrap 5's CSS reboot stylesheet:

mark {
  padding: $mark-padding;
  background-color: $mark-bg;
}

In your CSS, if you do this:

#autoComplete mark {
  padding: 0;
  background-color: none;
}

You should be fine, because #autoComplete mark has a specificity of 101, while mark only has 001.

https://polypane.app/css-specificity-calculator/

There's more talk about this specific topic here https://github.com/TarekRaafat/autoComplete.js/issues/264

folknor avatar Jan 10 '22 20:01 folknor

Thank you, Indeed adding a css class did work fine https://github.com/code-lts/doctum/blob/05d1c2872f9356dc73b6fb8dab56ba14175c805e/src/Resources/themes/default/doctum.js.twig#L273

williamdes avatar Jan 10 '22 23:01 williamdes