riktar / jkanban

Vanilla Javascript plugin for manage kanban boards
https://www.riccardotartaglia.it/jkanban/
Apache License 2.0
1.07k stars 297 forks source link

Feature Request: Board Class #85

Closed einazare closed 4 years ago

einazare commented 4 years ago

Hello there,

Nice plugin and big thanks to the maintainers of it. I would like to request a feature, for adding a class to the board elements (check below image). Screen Shot 2020-04-27 at 6 29 33 PM

For example, Bootstrap offers you some classes for setting a background color: https://getbootstrap.com/docs/4.4/utilities/colors/#background-color Or background gradient color: https://getbootstrap.com/docs/4.4/utilities/colors/#background-gradient The list can go on, and I would like to be able to use these classes directly on the Board Element, and not create a CSS file in which I would add the colors on the class that already exists. something like:

.kanban-board {
       background-color: #007bff!important;
}

Thank you for your time, Manu

marcosrocha85 commented 4 years ago

@riktar, because of class attribute which changes board title, we cannot just change behavior of class and create a titleClass. What do you think if we create a boardClass attribute to add css classes to entire column? Will it confuse people when using class and boardClass attributes?

lb- commented 4 years ago

Just an idea, you could use

      document.querySelectorAll('.kanban-board').forEach(function(boardElement) {
        boardElement.addClass('some-custom-class');
      });

Just be sure to add it directly after you set up the kanban...

var kanban = new jKanban({/*...*/});
marcosrocha85 commented 4 years ago

Just an idea, you could use

      document.querySelectorAll('.kanban-board').forEach(function(boardElement) {
        boardElement.addClass('some-custom-class');
      });

Just be sure to add it directly after you set up the kanban...

var kanban = new jKanban({/*...*/});

That the way I use. Just because the project uses jQuery. But in order to do that in vanilla javascript, I guess would be handy if was added a property to fit needs of column (board) css classes.