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

reduce specificity of generated stylesheets to 0 #1941

Merged
merged 4 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions src/legends/ramp.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ export function legendRamp(color, options) {
.call((svg) =>
// Warning: if you edit this, change defaultClassName.
svg.append("style").text(
`.${className}-ramp {
`:where(.${className}-ramp) {
display: block;
height: auto;
height: intrinsic;
max-width: 100%;
overflow: visible;
}
.${className}-ramp text {
:where(.${className}-ramp text) {
white-space: pre;
}`
)
Expand Down
14 changes: 7 additions & 7 deletions src/legends/swatches.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,16 @@ function legendItems(scale, options = {}, swatch) {
let extraStyle;

if (columns != null) {
extraStyle = `.${className}-swatches-columns .${className}-swatch {
extraStyle = `:where(.${className}-swatches-columns .${className}-swatch) {
display: flex;
align-items: center;
break-inside: avoid;
padding-bottom: 1px;
}
.${className}-swatches-columns .${className}-swatch::before {
:where(.${className}-swatches-columns .${className}-swatch::before) {
flex-shrink: 0;
}
.${className}-swatches-columns .${className}-swatch-label {
:where(.${className}-swatches-columns .${className}-swatch-label) {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
Expand All @@ -123,13 +123,13 @@ function legendItems(scale, options = {}, swatch) {
item.append("div").attr("class", `${className}-swatch-label`).attr("title", tickFormat).text(tickFormat)
);
} else {
extraStyle = `.${className}-swatches-wrap {
extraStyle = `:where(.${className}-swatches-wrap) {
display: flex;
align-items: center;
min-height: 33px;
flex-wrap: wrap;
}
.${className}-swatches-wrap .${className}-swatch {
:where(.${className}-swatches-wrap .${className}-swatch) {
display: inline-flex;
align-items: center;
margin-right: 1em;
Expand All @@ -150,12 +150,12 @@ function legendItems(scale, options = {}, swatch) {
return swatches
.call((div) =>
div.insert("style", "*").text(
`.${className}-swatches {
`:where(.${className}-swatches) {
font-family: system-ui, sans-serif;
font-size: 10px;
margin-bottom: 0.5em;
}
.${className}-swatch > svg {
:where(.${className}-swatch > svg) {
margin-right: 0.5em;
overflow: visible;
}
Expand Down
6 changes: 3 additions & 3 deletions src/plot.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,15 +257,15 @@ export function plot(options = {}) {
.call((svg) =>
// Warning: if you edit this, change defaultClassName.
svg.append("style").text(
`.${className} {
`:where(.${className}) {
--plot-background: white;
display: block;
height: auto;
height: intrinsic;
max-width: 100%;
}
.${className} text,
.${className} tspan {
:where(.${className} text),
:where(.${className} tspan) {
white-space: pre;
}`
)
Expand Down
6 changes: 3 additions & 3 deletions test/output/aaplBollinger.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions test/output/aaplBollingerCandlestick.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions test/output/aaplBollingerGridInterval.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions test/output/aaplBollingerGridSpacing.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions test/output/aaplCandlestick.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions test/output/aaplChangeVolume.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions test/output/aaplClose.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions test/output/aaplCloseClip.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions test/output/aaplCloseDataTicks.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions test/output/aaplCloseGridColor.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions test/output/aaplCloseGridInterval.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions test/output/aaplCloseGridIntervalName.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions test/output/aaplCloseGridIterable.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions test/output/aaplCloseImplicitGrid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions test/output/aaplCloseNormalize.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions test/output/aaplCloseUntyped.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading