Loading...
 
Skip to main content

History: Organization of button colors in Tiki

Source of version: 15

Copy to clipboard
            {HTML(wiki="0")}
<style>
.newbutton {
  display: inline-block;
  padding: 6px 12px;
  margin-bottom: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.42857143;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  -ms-touch-action: manipulation;
  touch-action: manipulation;
  cursor: pointer;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  background-image: none;
  border: 1px solid rgba(0, 0, 0, 0);
  border-radius: 4px;
}

.newprimary {
  color: rgb(255, 255, 255);
  background-color: rgb(51, 122, 183);
  border-color: rgb(46, 109, 164);
}

.newsuccess {
  color: rgb(255, 255, 255);
  background-color: rgb(92, 184, 92);
  border-color: rgb(76, 174, 76);
}

.newinfo {
  color: rgb(255, 255, 255);
  background-color: rgb(91, 192, 222);
  border-color: rgb(70, 184, 218);
}

.newwarning {
  color: rgb(255, 255, 255);
  background-color: rgb(240, 173, 78);
  border-color: rgb(238, 162, 54);
}

.newdanger {
  color: rgb(255, 255, 255);
  background-color: rgb(217, 83, 79);
  border-color: rgb(212, 63, 58);}

.newsecondary {
    color: rgb(255, 255, 255);
    background-color: rgb(108, 117, 125);
    border-color: rgb(108, 117, 125);
}</style>
{HTML}

The goal here is to make the meaning of button colors in Tiki more intuitive and consistent. In the Bootstrap update to version 4, part of Tiki 19, some button class names and default colors have changed from Bootstrap 3. (See [https://getbootstrap.com/docs/4.0/components/buttons/] .) The meanings conveyed by button colors may not be as clear now as they were in Bootstrap 3, when the default button color was essentially neutral and colors were used for special meaning and, even with Tiki and Bootstrap 3, there wasn't a clear pattern of button color use. 

For this reason, the button classes are being organized in the .tpl files, etc. and will be in the HTML and they will be most apparent in the Default Bootstrap theme. Other themes, of course, can style buttons as they please but the hope is that the organization of button colors makes sense and will benefit themes and users even if the themes' palettes vary from the Bootstrap default.

One suggestion is that sites could assign an admin theme that shows the button colors most clearly, and another site theme with perhaps less obvious colors that are toned down from the default ones.

|| __Button purpose category__ | __CSS class, and color in Bootstrap default theme__ | __Examples__
Make a significant non-destructive change | btn-primary (royal blue -#007bff) | Save, Apply, Rename, Select, Attach | {HTML()}<button class="newbutton newprimary">19primary</button>{HTML}
Confirmation for non-destructive change | btn-success (green) | Anti-CSRF confirmation | {HTML()}<button class="newbutton newsuccess">19success</button>{HTML}
Make a destructive change | btn-danger (red) | Delete, Remove | {HTML()}<button class="newbutton newdanger">19danger</button>{HTML}
Confirmation for destructive change | btn-warning (yellow) | Are you sure?  | {HTML()}<button class="newbutton newwarning">19warning</button>{HTML}
Display information%%%{TAG(tag="small")}Including buttons that navigate to another page to show content.{TAG} | btn-info (turquoise blue - #17a2b8) | History, Source, Preview, Find  | {HTML()}<button class="newbutton newinfo">19info</button>{HTML}
Make an insignificant change%%%{TAG(tag="small")}Including buttons that show/hide content without a page change.{TAG} | btn-secondary (gray) | Tabs/No tabs, Sort, Filter, Files, Comments, More  | {HTML()}<button type="button" class="newbutton newsecondary">19secondary</button>{HTML}||

* In principle, links that are used for navigation should be styled as links (text only or text with icon), not as buttons. But there can be exceptions such as widgets which call an action and also link to another page.
* On pages or sites where there aren't many buttons, the button colors might seem random, but as the number of buttons and user interactions increases, then hopefully the color pattern will be more evident and useful from a UI standpoint.
* For consistency this color scheme should be applied to icon buttons as well, like the magnifying-glass "search" icon and the "i" and "?" tooltip icons, in forms and so on, but not in an array like the admin icons where color consistency is more important.

Dev mailing list discussion starts here: [https://sourceforge.net/p/tikiwiki/mailman/message/36346433/] 

!! Edge cases
* The __Post new comment__ button leads eventually to a positive action so could possibly be considered ''btn-primary'', but this button itself only causes the comment form to display, so is ''btn-secondary''. The  __Post__ button in the comment form is ''btn-primary'' because it actually causes the action.
* Although clicking the __Clear all caches__ button is destructive in the sense that it deletes files in the caches, this button can be ''btn-primary'' because clearing the caches is a positive action (to remove unwanted files and use updated content, etc.).

!! Questions
* Where is the limit between significant and insignificant changes? {sign user="Chealer9" datetime="2018-06-21T17:14:46+00:00"}
** I don't know of a criteria yet but I would say that for any case where there is a question, it should be classified as signficant. {sign user="chibaguy" datetime="2018-06-24T07:36:25+00:00"}
* Is it allowed to use ''btn-primary'' for confirming a non-destructive change, or to make a destructive change? {sign user="Chealer9" datetime="2018-06-21T17:14:46+00:00"}
** I think it's more appropriate to use the success color to confirm a non-destructive change; and I think it would be confusing and inconsistent to use btn-primary to make a destructive change. {sign user="chibaguy" datetime="2018-06-24T07:36:26+00:00"}
*** I understand that another color would be more appropriate; my question was whether it is acceptable, because if it is unacceptable, that is not clear in the table's current state. {sign user="Chealer9" datetime="2018-06-26T14:48:39+00:00"}
        

History

Advanced
Information Version
Tue 05 of Nov, 2019 12:23 GMT-0000 Gary Cunningham-Lee Added info about prioritizing theme colors in buttons. 27
Wed 30 of Oct, 2019 11:30 GMT-0000 luciash d' being ?‍♂️ 26
Wed 30 of Oct, 2019 11:18 GMT-0000 luciash d' being ?‍♂️ 25
Tue 29 of Oct, 2019 04:47 GMT-0000 Gary Cunningham-Lee Updated Bootstrap doc link to point to latest version. 24
Tue 05 of Feb, 2019 14:08 GMT-0000 Gary Cunningham-Lee Text edited for clarity and to update time references. 23
Tue 05 of Feb, 2019 13:57 GMT-0000 Gary Cunningham-Lee Response to question added. 22
Tue 05 of Feb, 2019 12:58 GMT-0000 luciash d' being ?‍♂️ question about btn-secondary color 21
Sat 15 of Sep, 2018 17:47 GMT-0000 Gary Cunningham-Lee Simplified button labels. 20
Sun 15 of Jul, 2018 04:38 GMT-0000 Gary Cunningham-Lee Better color description for secondary. 19
Sun 15 of Jul, 2018 04:35 GMT-0000 Gary Cunningham-Lee Corrected (updated) secondary color description. 18
Sun 15 of Jul, 2018 04:33 GMT-0000 Gary Cunningham-Lee Corrected (updated) secondary color. 17
Sat 14 of Jul, 2018 16:54 GMT-0000 Gary Cunningham-Lee Moved example buttons to "CSS class, and color in Bootstrap default theme" column 16
Sat 14 of Jul, 2018 14:49 GMT-0000 Bernard Sfez / Tiki Specialist Changing button to html 15
Sat 14 of Jul, 2018 06:43 GMT-0000 Bernard Sfez / Tiki Specialist 14
Sat 14 of Jul, 2018 06:40 GMT-0000 Bernard Sfez / Tiki Specialist Setting buttons 13
Fri 13 of Jul, 2018 13:12 GMT-0000 Philippe Cloutier fix sentence on links 12
Tue 26 of Jun, 2018 14:48 GMT-0000 Philippe Cloutier 11
Sun 24 of Jun, 2018 09:08 GMT-0000 Gary Cunningham-Lee Added another button example. 10
Sun 24 of Jun, 2018 09:05 GMT-0000 Gary Cunningham-Lee Clarified blue button colors. 9
Sun 24 of Jun, 2018 08:56 GMT-0000 Gary Cunningham-Lee Added "Edge cases" section and a few cases. 8
Sun 24 of Jun, 2018 07:36 GMT-0000 Gary Cunningham-Lee Added info and views. 7
Fri 22 of Jun, 2018 14:21 GMT-0000 Gary Cunningham-Lee Turned off toc because the page is so short. 6
Thu 21 of Jun, 2018 17:15 GMT-0000 Philippe Cloutier fix typo. oops 5
Thu 21 of Jun, 2018 17:14 GMT-0000 Philippe Cloutier add Questions section 4
Thu 21 of Jun, 2018 17:10 GMT-0000 Philippe Cloutier color corrections and example clarification 3
Thu 21 of Jun, 2018 14:54 GMT-0000 Gary Cunningham-Lee Text clarification. 2
Thu 21 of Jun, 2018 14:48 GMT-0000 Gary Cunningham-Lee Page created. 1