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

Add Bikeshed's style-dfn-panels styles to standard.css #343

Merged
merged 1 commit into from
Oct 2, 2020
Merged
Changes from all commits
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
49 changes: 49 additions & 0 deletions resources.whatwg.org/standard.css
Original file line number Diff line number Diff line change
Expand Up @@ -571,3 +571,52 @@ pre > code.css, pre.highlight.lang-css {
.wpt-tests-margin.wrapped > :not(input) {
display: none;
}

/* Dfn panels */
.dfn-panel {
display: inline-block;
position: absolute;
z-index: 35;
height: auto;
width: -webkit-fit-content;
width: fit-content;
max-width: 300px;
max-height: 500px;
overflow: auto;
padding: 0.5em 0.75em;
font: small Helvetica Neue, sans-serif, Droid Sans Fallback;
background: #ddd;
color: black;
border: outset 0.2em;
cursor: initial;
}
.dfn-panel:not(.on) { display: none; }
.dfn-panel * { margin: 0; padding: 0; text-indent: 0; }
.dfn-panel > b { display: block; }
.dfn-panel a { color: black; }
.dfn-panel a:not(:hover) { text-decoration: none !important; border-bottom: none !important; }
.dfn-panel p:not(.spec-link) { font-weight: bolder; }
.dfn-panel > b + b, .dfn-panel > * + p { margin-top: 0.25em; }
.dfn-panel ul { padding: 0; }
.dfn-panel li { list-style: inside; }
.dfn-panel.activated {
position: fixed;
left: .5em;
bottom: 2em;
margin: 0 auto;
max-width: calc(100vw - 1.5em - .4em - .5em);
max-height: 30vh;
}

/* Elements that trigger a dfn panel when clicked.
The dfn-paneled class is specific to Bikeshed, while dfnEnabled
identifies builds of the HTML spec that support dfn panels. */
.dfn-paneled,
body.dfnEnabled dfn,
Copy link
Member

Choose a reason for hiding this comment

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

I guess we probably can't use :is() yet, sigh.

body.dfnEnabled h2[data-dfn-type],
body.dfnEnabled h3[data-dfn-type],
body.dfnEnabled h4[data-dfn-type],
body.dfnEnabled h5[data-dfn-type],
body.dfnEnabled h6[data-dfn-type] {
cursor: pointer;
}