Megafry
Megafry

Eugène Fritz

@Megafry

5 Posts 0 Views

  • No matching results...
  • Searching...

/ 255

Aha - Update or set an get params to a url

const urlForOneQuest = (href) => {
const Url = new URL(href)
Url.searchParams.set('guests', 'A')
return Url.href
}
console.log(urlForOneQuest('https://www.simplebooking.it/ibe2/hotel/5821/?in=2025-10-28&out=2025-10-29&guests=A%2CA'))

Aha - disable stylelint options for multiple lines of CSS

If you need to style elements for which you can not change the class name, wrap your code with these comments

ex: disable `selector-class-pattern`

/* stylelint-disable selector-class-pattern */
.flatpickr-calendar.hasTime {}
/* stylelint-enable selector-class-pattern */

Aha - CSS @supports
Use the new @supports rule to add fallback declarations for older browsers.
Write modern CSS and use the `supports not` to make it easier to delete the code once all browsers support a feature.

.open path  {
d: path("M27.7 ... 4.8Z");
}

@supports not (d: path("")) {
.open path {
--fill-color: transparent;
--fill-color-active: currentColor;
}
}


Doc: developer.mozilla.org/en-US/docs/Web/CSS/@supports
Demo, fallback for safari: codepen.io/Megafry/pen/GgKggry

Aha - Firefox and submit event
If you dispatch a submit event, firefox will ignore all preventDefault, therefore you need to add `cancelable: true`

form.dispatchEvent(new CustomEvent("submit", {
cancelable: true
}))