You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Guy i just want to use @preline/overlay. Not using Preline UI as a package in my Rails 7 app.
i installed it with yarn
i added it to my tailwind.config.js module.exports = { content: [ './app/helpers/**/*.rb', './app/javascript/**/*.js', './app/views/**/*', 'node_modules/@preline/**/*.js' ], plugins: [ require('postcss-import'), require('@tailwindcss/forms'), require('autoprefixer') ] }
In my application.js import HSOverlay from "@preline/overlay"; window.HSOverlay = HSOverlay;
I'm calling offcanvas in offcanvas_controller.js
`import {Controller} from "@hotwired/stimulus"
// Connects to data-controller="offcanvas"
export default class extends Controller {
initialize(event) {
var element = document.querySelector('#hs-offcanvas-right');
if (element) {
this.offcanvas = new HSOverlay(element);
if (element.classList.contains('hidden')) {
this.offcanvas.open();
}
}
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Guy i just want to use @preline/overlay. Not using Preline UI as a package in my Rails 7 app.
i installed it with yarn
i added it to my tailwind.config.js
module.exports = { content: [ './app/helpers/**/*.rb', './app/javascript/**/*.js', './app/views/**/*', 'node_modules/@preline/**/*.js' ], plugins: [ require('postcss-import'), require('@tailwindcss/forms'), require('autoprefixer') ] }
In my application.js
import HSOverlay from "@preline/overlay"; window.HSOverlay = HSOverlay;
I'm calling offcanvas in offcanvas_controller.js
`import {Controller} from "@hotwired/stimulus"
// Connects to data-controller="offcanvas"
export default class extends Controller {
initialize(event) {
var element = document.querySelector('#hs-offcanvas-right');
if (element) {
this.offcanvas = new HSOverlay(element);
}
`
Not working without any errors.
Beta Was this translation helpful? Give feedback.
All reactions