mirror of
https://gh.wpcy.net/https://github.com/elementor/one-click-accessibility.git
synced 2026-04-21 02:13:53 +08:00
* update: column actions * add: short and long button formats with tooltips * update: simplify the tooltip approach * add: tooltip to the column title * update: move css to existing file * add: media query listeners for column resize * update: logic to resize the column and button
220 lines
4.2 KiB
SCSS
220 lines
4.2 KiB
SCSS
#accessibility_status, .accessibility_status {
|
|
width: auto;
|
|
}
|
|
|
|
.accessibility_status.column-accessibility_status {
|
|
vertical-align: middle;
|
|
|
|
.accessibility_status_content {
|
|
display: flex;
|
|
gap: 16px;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
width: auto;
|
|
|
|
&__stats {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 6px;
|
|
flex-grow: 3;
|
|
}
|
|
|
|
&__summary {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
font-size: 12px;
|
|
}
|
|
|
|
&__text {
|
|
// Optional extra styling for the fixed count
|
|
}
|
|
|
|
&__percentage {
|
|
border-radius: 12px;
|
|
padding: 2px 6px;
|
|
&.red {
|
|
background-color: #FDECEC;
|
|
color: #9A1A1A;
|
|
}
|
|
&.orange {
|
|
background-color: #FBF1E6;
|
|
color: #823F14;
|
|
}
|
|
&.grey {
|
|
background-color: #E2E3E5;
|
|
color: #000;
|
|
}
|
|
}
|
|
|
|
&__bar {
|
|
background-color: #e2e3e5;
|
|
height: 6px;
|
|
border-radius: 3px;
|
|
overflow: hidden;
|
|
}
|
|
|
|
&__bar-fill {
|
|
background-color: #555;
|
|
height: 100%;
|
|
transition: width 0.3s ease;
|
|
}
|
|
|
|
&__actions {
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
|
|
.button {
|
|
min-width: 80px;
|
|
text-align: center;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/* CSS tooltips */
|
|
.ea11y-tooltip {
|
|
position: relative;
|
|
|
|
&::after {
|
|
display: none;
|
|
position: absolute;
|
|
z-index: 9999999;
|
|
padding: 6px 8px 5px;
|
|
border-radius: 3px;
|
|
opacity: 0;
|
|
color: #fff;
|
|
background: rgba(0, 0, 0, 0.8);
|
|
text-shadow: none;
|
|
font: normal normal 11px/1.45 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
|
|
text-align: center;
|
|
white-space: nowrap;
|
|
text-decoration: none;
|
|
letter-spacing: normal;
|
|
text-transform: none;
|
|
word-wrap: break-word;
|
|
content: attr(data-label);
|
|
pointer-events: none;
|
|
-webkit-font-smoothing: subpixel-antialiased;
|
|
}
|
|
|
|
&::before {
|
|
display: none;
|
|
position: absolute;
|
|
z-index: 9999999;
|
|
width: 0;
|
|
height: 0;
|
|
border: 5px solid transparent;
|
|
opacity: 0;
|
|
color: rgba(0, 0, 0, 0.8);
|
|
content: "\00a0";
|
|
pointer-events: none;
|
|
}
|
|
|
|
&:hover::before,
|
|
&:hover::after,
|
|
&:focus::before,
|
|
&:focus::after {
|
|
display: inline-block;
|
|
text-decoration: none;
|
|
animation-name: ea11y-tooltip-appear;
|
|
animation-duration: 0.1s;
|
|
animation-timing-function: ease-in;
|
|
animation-fill-mode: forwards;
|
|
}
|
|
|
|
// North tooltip (above button)
|
|
&-n::after {
|
|
right: 50%;
|
|
bottom: 100%;
|
|
margin-bottom: 5px;
|
|
transform: translateX(50%);
|
|
}
|
|
|
|
&-n::before {
|
|
top: -5px;
|
|
right: 50%;
|
|
bottom: auto;
|
|
margin-right: -5px;
|
|
border-top-color: rgba(0, 0, 0, 0.8);
|
|
}
|
|
|
|
// Hide tooltips when not needed
|
|
&-hidden::before,
|
|
&-hidden::after {
|
|
display: none !important;
|
|
}
|
|
}
|
|
|
|
@keyframes ea11y-tooltip-appear {
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
}
|
|
|
|
/* Accessibility button enhancements */
|
|
.ea11y-accessibility-button {
|
|
position: relative;
|
|
transition: all 0.2s ease;
|
|
overflow: visible; /* IE 11 needs this for buttons */
|
|
min-height: 24px !important;
|
|
font-size: 11px !important;
|
|
|
|
&:hover {
|
|
transform: translateY(-1px);
|
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
}
|
|
|
|
&:focus {
|
|
outline: 2px solid #0073aa;
|
|
outline-offset: 1px;
|
|
}
|
|
|
|
.ea11y-button-text {
|
|
white-space: nowrap;
|
|
transition: all 0.2s ease;
|
|
}
|
|
}
|
|
|
|
/* Column title responsive behavior */
|
|
.ea11y-column-title {
|
|
transition: opacity 0.2s ease;
|
|
}
|
|
|
|
/* Hide column title when column is too narrow */
|
|
@container (max-width: 80px) {
|
|
.ea11y-column-title {
|
|
display: none;
|
|
}
|
|
}
|
|
|
|
/* Fallback for browsers without container queries */
|
|
@media screen and (max-width: 480px) {
|
|
.ea11y-column-title {
|
|
display: none;
|
|
}
|
|
}
|
|
|
|
/* Responsive behavior for narrow columns */
|
|
@media screen and (max-width: 782px) {
|
|
.ea11y-accessibility-button .ea11y-button-text {
|
|
font-size: 11px;
|
|
}
|
|
}
|
|
|
|
/* Dark mode support */
|
|
@media (prefers-color-scheme: dark) {
|
|
.ea11y-tooltip::after {
|
|
background: #2c3338;
|
|
color: #f0f0f1;
|
|
}
|
|
|
|
.ea11y-tooltip-n::before {
|
|
border-top-color: #2c3338;
|
|
}
|
|
}
|
|
|