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

report: tweak summary marker styles #12267

Merged
merged 6 commits into from
Apr 13, 2021
Merged

report: tweak summary marker styles #12267

merged 6 commits into from
Apr 13, 2021

Conversation

connorjclark
Copy link
Collaborator

@connorjclark connorjclark commented Mar 19, 2021

related: #12089

image

Latest Chrome decides to emit a deprecation warning for ::-webkit-details-marker (it probably shouldn't...). this doesn't actually avoid that, but I thought we should use the new ::marker just cuz.

still works in FF/Safari/Chrome. actually, nothing really changes :) this will be eventually necessary, I guess Chrome will remove old support one day?

@connorjclark connorjclark requested a review from a team as a code owner March 19, 2021 01:41
@connorjclark connorjclark requested review from adamraine and removed request for a team March 19, 2021 01:41
@google-cla google-cla bot added the cla: yes label Mar 19, 2021
@connorjclark connorjclark changed the title Marker report: use ::marker Mar 19, 2021
}

/* Older webkit browsers might have -webkit-details-marker,
and require setting list style type to none. */
.lh-audit-group > summary,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

would have used supports not selector(...) but safari doesn't support that.

@@ -541,8 +541,19 @@
background-color: var(--color-hover);
}

/* Hide the expandable arrow icon, three ways: via the CSS Counter Styles spec, for webkit/blink browsers, hiding the polyfilled icon */
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

link is dead, i found the old sass code but it didn't seem helpful to have here

comment confused me so I just removed. maybe someone could help me reword? we aren't use @counter-styles (whatever that is), and I'm don't know what "polyfilled icon" is referring to.

Copy link
Member

Choose a reason for hiding this comment

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

counter styles spec was .... incorrect.

"polyfilled icon" means the CSS added by deatils-element-polyfill (which is used in PSI for... old edge users and IE11 users?)
we can remove that polyfill now, tbh.

@brendankenny brendankenny assigned paulirish and unassigned adamraine Mar 19, 2021
Copy link
Member

@paulirish paulirish left a comment

Choose a reason for hiding this comment

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

thx for looking into this. i think we can simplify it even more.

and yeah thanks for filing the chromium issue.. agree it's impractical to not use the -webkit prefix if you care about either safari or FF.

@@ -541,8 +541,19 @@
background-color: var(--color-hover);
}

/* Hide the expandable arrow icon, three ways: via the CSS Counter Styles spec, for webkit/blink browsers, hiding the polyfilled icon */
/* https://github.com/javan/details-element-polyfill/blob/master/src/details-element-polyfill/polyfill.sass */
/* We want to hide the browser's default arrow marker on summary elements. */
Copy link
Member

@paulirish paulirish Mar 20, 2021

Choose a reason for hiding this comment

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

i rewrote this to be a little simpler. (and document why we do each thing)

/* We want to hide the browser's default arrow marker on summary elements. Admittedly, it's complicated. */
.lh-audit-group > summary,
.lh-expandable-details > summary {
  /* Blink 89+ and Firefox will hide the arrow when display is changed from (new) default of `list-item` to block.  https://chromestatus.com/feature/6730096436051968*/
  display: block;
}
/* Safari and Blink <=88 require using the -webkit-details-marker selector */
.lh-audit-group > summary::-webkit-details-marker,
.lh-expandable-details > summary::-webkit-details-marker {
  display: none;
}
/* When the details-element-polyfill is used, it adds an ugly arrow. Hide it. https://github.com/javan/details-element-polyfill/blob/main/src/styles.js */
.lh-audit-group > summary:before,
.lh-expandable-details > summary:before {
  display: none;
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I tweaked my comments a bit, but IMO it was already specifying why things were being done at an appropriate level of detail (new/old browsers, tale as old as time). The provided links provides more detail (like what version of blink the newer stuff is supported).

got rid of the @supports block too, the idea there was to eventually have chrome not emit a deprecation warning if it was smart and checked for these rules in a better way; but the deprecation is now removed, so whatever.

Copy link
Member

Choose a reason for hiding this comment

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

I'm unclear why this has to be contentious..

I tweaked my comments a bit, but IMO it was already specifying why things were being done at an appropriate level of detail

if that were the case, then you would have deleted the list-style-type: none; rule. it's totally unnecessary.

@@ -541,8 +541,19 @@
background-color: var(--color-hover);
}

/* Hide the expandable arrow icon, three ways: via the CSS Counter Styles spec, for webkit/blink browsers, hiding the polyfilled icon */
Copy link
Member

Choose a reason for hiding this comment

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

counter styles spec was .... incorrect.

"polyfilled icon" means the CSS added by deatils-element-polyfill (which is used in PSI for... old edge users and IE11 users?)
we can remove that polyfill now, tbh.

@connorjclark connorjclark changed the title report: use ::marker report: use tweak summary marker styles Apr 9, 2021
@paulirish paulirish changed the title report: use tweak summary marker styles report: tweak summary marker styles Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants