Closed eguiraud closed 1 year ago
Yeah that's being applied to make room for the Clear
button in the search input — resetStyles
only affects stripping the main site styles away, but doesn't avoid setting styles specifically for the PagefindUI. I can see how it's not ideal, though.
However, the best solution is to use the newer modular-ui package, as this lets you use your own input altogether, so you have a lot more control over the process 🙂
I'll leave this open as a potential additional option for Pagefind, such as unstyled: true
Thank you for the quick reply!
I guess my point was that with resetStyles: false
there is no value in setting that specific style to that specific amount of pixels, it's virtually never going to be appropriate.
I'll check out the modular-ui, thanks!
To clarify, resetStyles
doesn't control whether Pagefind's styles apply — that's controlled by choosing to include or not include the pagefind-ui.css
file on your page. The purpose of resetStyles
is to reduce conflicts between Pagefind's CSS and the CSS of the site it is embedded on. It's valid to set resetStyles: false
and use the Pagefind CSS, which just allows the two to merge somewhat. In this case the UI CSS will still be putting the Clear
button at the right of the input, so we still need the padding.
Removing the padding is only appropriate if the Pagefind CSS is omitted altogether, which the Pagefind UI doesn't really have any awareness of currently, which is why unstyled: true
might be a nice addition as a signal for whether you intend to use the pagefind-ui.css
file 🙂
Hope that makes sense! Check back in if you have any feedback on the modular-ui, also 🙂
Ah, I see, thanks. I did not realize you could still use pagefind-ui.css
with restStyles: false
:+1:
Closing this out as I think things are covered with the existing feature set — let me know if that isn't the case!
Hello,
pagefind was a breeze to set up, thank you very much for working on this! The hardest part was the styling :smile:
One annoyance I had was that even if I create the
PageFindUI
object with theresetStyles: false
option (which implies I will apply my own styling to the UI), when I start to write in the search bar the Pagefind JS code addsstyle="padding-right: 109px;"
to theinput
element of the search form.I can hack things around it, but it would be nicer if it didn't :)