Giter Club home page Giter Club logo

mendix.cssclassswitcher's Introduction

Css Class Switcher

A Mendix widget that adds CSS classes determined by a microflow (or nanoflow) to elements determined by CSS selector.

Typical usage scenario

It's useful in applications that need to determine styling based on arbitrary logic and change it dynamically in runtime:

  • An example may be a multi-tenant app with different styling for different brands, depending on settings of the current user.
  • Another use case would be to allow your users to choose between multiple theme or skins for your application, depending on their preferences.
  • You can also improve accessibility by switching to styling with e.g. bigger fonts and cleaner layout with less distractions for users with visual or cognitive impairments.

Example application

Here you can find a simple yet beautiful sample app that switches its styling between light and dark depending on current user theme stored in Account entity.

Usage

Place the widget inside your app and provide the following settings:

  • Microflow: A microflow that has no parameters and returns a string with CSS classes that should be added to target elements. Multiple classes can be seperated with a space.
  • Nanoflow: Alternatively, you can use a nanoflow instead of microflow - as above.
  • Target element selector: Optional CSS selector of target elements to add the classes to. If empty, the parent element of the widget will be used.
  • CSS classes to remove: Optional CSS classes to be removed from the target elements. Multiple classes can be seperated with a space.

Inspired by / thanks to

mendix.cssclassswitcher's People

Contributors

austinmcnicholas avatar deadlyembrace avatar sergiuszwoznicki avatar

Watchers

 avatar

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.