riktar / jkanban

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

Set class to main element #40

Closed vetash closed 5 years ago

vetash commented 5 years ago

Hello, how can i change style of main element? <main class="kanban-drag"></main> default I mean i want to set different classes to each main elements.

marcosrocha85 commented 5 years ago

Hi @vetash , Do you mean the board's class property?

[
    {
        "id"    : "board-id-1",               // id of the board
        "title" : "Board Title",              // title of the board
        "class" : "class1,class2,...",        // css classes to add at the title
        "dragTo": ['another-board-id',...],   // array of ids of boards where items can be dropped (default: [])    
        "item"  : [                           // item of this board
            {
                "id"    : "item-id-1",        // id of the item
                "title" : "Item 1"            // title of the item
            },
            {
                "id"    : "item-id-2",
                "title" : "Item 2"
            }
        ]
    },
    {
        "id"    : "board-id-2",               
        "title" : "Board Title 2"
    }
]
vetash commented 5 years ago

Yes, but class param affect only for board title not body.

marcosrocha85 commented 5 years ago

Can you tell us what you intending to do? Is that a scroll? A background image? Or something else?

vetash commented 5 years ago

At least i want to set different color on different boards.

marcosrocha85 commented 5 years ago

Unfortunately, there isn't a way to select main tag by CSS starting from child (my initial thought was to reach div.kanban-board by it's child with a specific class. By the way, adding a bodyClass property on board will make possible add scroll on boards, which already was requested here at #33.

@riktar I created a pull request for this.