Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding tab borders #6593

Open
wants to merge 2 commits into
base: current
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 63 additions & 1 deletion website/src/css/custom.css
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than using hard-coded hex values, can we choose from the existing variables available at the top of this custom.css file? That will help us stay within our brand colors, while also making it easier to update colors across the board if needed down the road.

Original file line number Diff line number Diff line change
Expand Up @@ -2143,4 +2143,66 @@ table th {
[data-theme='dark'] table th {
color: #000000; /* Black text on darker background */
font-weight: bold;
}
}

.tabs {
background-color: transparent;
padding: 10px;
}

/* Default color and border for tabs */
.tabs__item {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In an effort to reduce the amount of custom colors used, would we be able to swap this with the var(--color-white) variable. That color is close enough to white where it shouldn't be too noticeable.

background-color: #f9fbfc; /* Sets the tab color the same as the file borders */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same note about using available color variables here, can we swap all uses of #ccc with a similar color currently available as a variable?

border: 2px solid #ccc;
padding: 5px 10px;
margin-right: 5px;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.3s;
}

/* Default color and border for tabs in dark mode */
[data-theme='dark'] .tabs__item {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid using black (not a brand color), can we swap this and anywhere #000 is used with --color-primary-blue, which is set to #262a38?

background-color: #000000;
border: 1px solid #ccc;
padding: 5px 10px;
margin-right: 5px;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.3s;
}

/*Color when hovering over tabs */
.tabs__item:hover {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#d95b3b is not an available brand color. Could we swap this with #DE5D43 or #ff694a? #ff694a has a variable already, but a new variable would need to be created for #DE5D43 if you go with that one.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, on hover, the lighter text is still set on the tab while the orange background is applied. This doesn't pass the WCAG accessibility check for contrast link here. The text color may need to be updated on hover to match the color when the tab is active.
image

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And on hover, can we have the border color update to match the background color as well? Similar to how the border updates for the active tab.

background-color: #D95B3B;
}

/* Color when the tab is clicked*/
.tabs__item--active {
background-color: #D95B3B;
color: rgb(0, 0, 0);
border-color: #D95B3B;
}

[data-theme='dark'] .tabs__item--active {
background-color: #D95B3B;
color: white;
border-color: #D95B3B;
}

/* Sets the tab content border and background color */
[data-theme='dark'] .tabs-container{
border: 1px solid #ccc;
padding: 15px;
border-radius: 10px;
margin-top: 10px;
background-color: transparent;
}

[data-theme='light'] .tabs-container{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In light mode, can we use a lighter color for the border? The var(--ifm-toc-border-color) variable might be a good option, which is the current border color for the table of contents.

border: 1px solid #000000;
padding: 15px;
border-radius: 10px;
margin-top: 10px;
background-color: transparent;
}
Loading