Code Monkey home page Code Monkey logo

Comments (5)

omvaishnav avatar omvaishnav commented on June 12, 2024 1

Thank you, Ain, for providing clarification. I have an additional question. Is there a way to configure a global class for either the <html> or <body> tag when the smart banner is active?

from smartbanner.js.

ain avatar ain commented on June 12, 2024

Inclusion of the script is of course dependant on the individual project setup. The example use-case in the README is illustrational.

Please make sure that the smartbanner.min.js and smartbanner.min.css are placed with the rest of your CSS and JS assets so that the files are publicly accessible for end-users.

from smartbanner.js.

omvaishnav avatar omvaishnav commented on June 12, 2024

Do we need to manually copy both files from the package and place them in the assets folder? If that's the case, what happens when the package receives updates to these files? Is there a more efficient way to handle updates and ensure that our assets stay synchronized with the package changes?

from smartbanner.js.

ain avatar ain commented on June 12, 2024

It's a task that your local setup has to consider during the build and/or asset compilation. Exposing gigabytes of node_modules to public is not a good idea.

from smartbanner.js.

ain avatar ain commented on June 12, 2024

Good question.

It is not directly possible, but what you could do is:

  1. use custom design modifier which adds a specific class not to the body or html, but to the wrapper element which smartbanner is added to.
  2. use smartbanner API and listen to init of smartbanner and add the global class to html or body automatically whenever you have the smartbanner added, e.g.:
document.addEventListener('smartbanner.init', javascript_function_to_add_class_to_body);

from smartbanner.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.