These notes are related to mcUITabs and cover some of the issues developing the styles.
Active Tab - part 1
The problem is that IE 11 does not support setting fontWeight to initial.
tab_button.style.fontWeight = 'bold' ; // this works mcCurrentTab.style.fontWeight = 'initial' ; // this has no effect in IE 11 |
It is easy to verify the failure using the w3schools font-weight interactive test page. Just click the provided radio buttons - it is obvious that initial is simply not supported!!!
That's when I decided to click on the Read about initial link.
Note: The initial keyword is not supported in Internet Explorer 11 and earlier versions. |
However, this time Microsoft should not take all the heat - w3schools is extremely negligent not to mark every page where initial is an option with a disclaimer that IE does not support that value. Simply providing a link really isn't enough. (But it is better than nothing.)
More
tablinks[i].style.backgroundColor = ""; ref - works in all browsers panel.style.maxHeight = null ref - fails in IE 11 (Windows 10) |
the data type of null is an object |
At any rate, the w3schools example shown above should be considered an error.
Active Tab - part 2
In addition, all the tested browsers change the width of the tab when the text is bold. I find this irritating and non-professional. (non-acceptable !!)
As a result, I modified the component to change the tab background color to indicate the currently selected tab.
To make this easier for designers to modify, I placed the specific colors in a style definition and modified the code to switch styles.
The bold contrast was very pronounced in Chrome, but difficult to distinguish in Edge. In addition, the width's of the tabs changed as they were clicked. (There is no reason for bold text to take up more space than normal text - but that is how the browsers do it.) As a result, I decided to change the tab background color instead.
First I tried background-color:#f4f1de;, but there wasn't enough contrast on Windows 10 (laptop), so I changed it to background-color:#f4f1ed;.
light, unselected #f4f1de excellent on Windows XP, not enough contrast on Windows 10 light, unselected #f4f1ed much better for Windows 10 dark, selected #ece9d8 same as tab page |
Once the colors were fixed, there was still too much space between the tab buttons. This is because I define each button on a separate line, and the browser consequently places a space between each pair of buttons.
I tried using float:left, but had a number of issues. The first was that the tab panel was formatted on the same line as the tabs. There were 2 ways to fix this
To be clear
clear: both; /* fixes the button float left */ |
.mcUITab_Buttons { word-spacing: -4px; /* better than float:left */ height: 19px; /* button default height */ } |
To fix the overlap problem, I moved the height style to the .mcUITab_Button class.
.mcUITab_Buttons { word-spacing: -4px; /* better than float:left */ } .mcUITab_Button { background-color:#f4f1ed; /* lighter than the panel */ border-bottom-style:none; height: 19px; /* button default height */ } |
An example of the final solution is provided in the basic user guide, while most of the details are here. (Yes, there is enough for a separate page.)
Author: Robert Clemenzi