Open
Show file tree
Hide file tree
Changes from all commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Failed to load files.
Original file line numberDiff line numberDiff line change
Expand Up@@ -43,9 +43,10 @@ proto.update = function(graphInfo, buttons) {
var modeBarId = 'modebar-' + fullLayout._uid;

this.element.setAttribute('id', modeBarId);
this._uid = modeBarId;
this.element.setAttribute('role', 'toolbar');

this.element.className = 'modebar';
this._uid = modeBarId;
this.element.className = 'modebar modebar--custom';
if(context.displayModeBar === 'hover') this.element.className += ' modebar--hover ease-bg';

if(fullLayout.modebar.orientation === 'v') {
Expand DownExpand Up@@ -145,8 +146,9 @@ proto.createGroup = function() {
*/
proto.createButton = function(config) {
var _this = this;
var button = document.createElement('a');
var button = document.createElement('button');

button.setAttribute('type', 'button');
button.setAttribute('rel', 'tooltip');
button.className = 'modebar-btn';

Expand All@@ -155,7 +157,10 @@ proto.createButton = function(config) {
// for localization: allow title to be a callable that takes gd as arg
else if(typeof title === 'function') title = title(this.graphInfo);

if(title || title === 0) button.setAttribute('data-title', title);
if(title || title === 0) {
button.setAttribute('data-title', title)
button.setAttribute("aria-label", title)
};

if(config.attr !== undefined) button.setAttribute('data-attr', config.attr);

Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,7 +8,7 @@
@include vendor('transition', background-color 0.3s ease 0s);
}

.modebar--hover > :not(.watermark) {
.modebar--hover> :not(.watermark) {
opacity: 0;
@include vendor('transition', opacity 0.3s ease 0s);
}
Expand All@@ -17,6 +17,10 @@
opacity: 1;
}

&:focus-within .modebar--hover .modebar-group {
opacity: 1;
}

.modebar-group {
float: left;
display: inline-block;
Expand All@@ -25,6 +29,11 @@
position: relative;
vertical-align: middle;
white-space: nowrap;

a {
Copy link
Contributor

Choose a reason for hiding this comment

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

@davidangarita1 do we still use this?

Copy link
Author

Choose a reason for hiding this comment

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

By converting the Anchor to Button they were misaligned, this style is to focus the Plotly logo into the mode bar

Copy link
Contributor

@ayjayt ayjayt Jun 5, 2025

Choose a reason for hiding this comment

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

i mean the anchor tag, is there still an anchor tag?

edit: ok, i get it

display: grid;
place-content: center;
}
}

.modebar-btn {
Expand All@@ -36,15 +45,20 @@
cursor: pointer;
line-height: normal;
box-sizing: border-box;
border: none;
background: transparent;

svg {
position: relative;
top: 2px;
Copy link
Contributor

Choose a reason for hiding this comment

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

@davidangarita1 why did we get rid of this?

Copy link
Author

Choose a reason for hiding this comment

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

By converting the anchor to Button they are misaligned, this style is that the buttons icon is centered

}

&.modebar-btn--logo {

&:focus-visible {
outline: 1px solid black;
outline-offset: 1px;
border-radius: 3px;
}

&.modebar-btn--logo {}
}

.modebar.vertical {
Expand All@@ -53,9 +67,11 @@
flex-wrap: wrap;
align-content: flex-end;
max-height: 100%;

svg {
top: -1px;
top: -1px;
}

.modebar-group {
display: block;
float: none;
Expand All@@ -67,4 +83,4 @@
text-align: center;
}
}
}
}