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

fix: new semantic HTML selectors #887

Merged
merged 17 commits into from
Nov 16, 2021
Merged
2 changes: 1 addition & 1 deletion assets/legacy/styles/_epub-house-style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ display: none; */
}

.short-title,
h6.short-title {
p.short-title {
arzola marked this conversation as resolved.
Show resolved Hide resolved
display: none;
}

Expand Down
14 changes: 7 additions & 7 deletions assets/legacy/styles/_mobi-house-style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -362,17 +362,17 @@ Version: 2.0
font-style: normal;
}

h3.author {
p.author {
font-weight: normal;
font-style: normal;
}

h4.publisher {
p.publisher {
font-weight: normal;
font-style: normal;
}

h5.publisher-city {
p.publisher-city {
font-weight: normal;
font-style: normal;
}
Expand Down Expand Up @@ -416,7 +416,7 @@ Version: 2.0
text-align: center;
}

h3.part-number {
p.part-number {
font-weight: normal;
font-style: normal;
font-size: 1.3em;
Expand All @@ -434,7 +434,7 @@ Version: 2.0
text-align: center;
}

h3.chapter-number {
p.chapter-number {
font-weight: normal;
font-style: normal;
font-size: 1.2em;
Expand All @@ -452,7 +452,7 @@ Version: 2.0
text-align: center;
}

h2.chapter-subtitle {
p.chapter-subtitle {
font-weight: normal;
font-style: normal;
font-size: 0.9em;
Expand All @@ -461,7 +461,7 @@ Version: 2.0
text-align: center;
}

h2.chapter-author {
p.chapter-author {
font-weight: normal;
font-style: normal;
font-size: 0.8em;
Expand Down
16 changes: 8 additions & 8 deletions assets/legacy/styles/_pdf-house-style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -752,19 +752,19 @@ meta[name="pb-publisher-city"] {

/* PART & CHAPTER STRINGS */

.part-title-wrap h3.part-number {
.part-title-wrap p.part-number {
string-set: part-number content();
}

.part-title-wrap h1.part-title {
string-set: part-title content();
}

h3.chapter-number {
p.chapter-number {
string-set: chapter-number content();
}

div.chapter.numberless h3.chapter-number {
div.chapter.numberless p.chapter-number {
display: none;
}

Expand All @@ -778,20 +778,20 @@ div.back-matter .back-matter-title-wrap > h1:first-of-type {
/* "short title override" ... this sets short chapter title content (for running header) but does not display it.
it can cause problems with spacing of things, so be careful to design around it */

div.front-matter > div.ugc h6.short-title:first-of-type,
div.chapter > div.ugc h6.short-title:first-of-type,
div.back-matter > div.ugc h6.short-title:first-of-type {
div.front-matter > div.ugc p.short-title:first-of-type,
div.chapter > div.ugc p.short-title:first-of-type,
div.back-matter > div.ugc p.short-title:first-of-type {
string-set: section-title content() !important; /* override running header */
visibility: hidden; /* display:none breaks string-set: */
font-size: 0;
height: 0;
}

div.ugc h2.chapter-author {
div.ugc p.chapter-author {
string-set: chapter-author content();
}

div.ugc h2.chapter-subtitle {
div.ugc p.chapter-subtitle {
string-set: chapter-subtitle content();
}

Expand Down
6 changes: 3 additions & 3 deletions packages/buckram/assets/styles/components/_colors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ h1.front-matter-title {
}

// PART TITLE COLOR
h3.part-number {
p.part-number {
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't it be better if we removed element selectors altogether and just targeted elements with the .part-number class?

Copy link
Contributor Author

@arzola arzola Nov 8, 2021

Choose a reason for hiding this comment

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

Yes, we discussed that on Friday I wasn't sure if the .part-number exists in other contexts but definitely I can look into that

color: if-map-get($part-number-color, $type);
}

Expand All @@ -185,11 +185,11 @@ h2.chapter-title {
color: if-map-get($chapter-title-color, $type);
}

h2.chapter-subtitle {
p.chapter-subtitle {
color: if-map-get($chapter-subtitle-color, $type);
}

h2.chapter-author {
p.chapter-author {
color: if-map-get($chapter-author-color, $type);
}

Expand Down
12 changes: 6 additions & 6 deletions packages/buckram/assets/styles/components/pages/_titles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ h2.subtitle {
}
}

h3.author {
p.author {
margin-top: if-map-get($title-author-margin-top, $type);
margin-right: if-map-get($title-author-margin-right, $type);
margin-left: if-map-get($title-author-margin-left, $type);
Expand Down Expand Up @@ -108,7 +108,7 @@ div.publisher-logo {
text-align: $title-publisher-logo-text-align;
}

h4.publisher {
p.publisher {
display: block;
float: if-map-get($title-publisher-float, $type);
margin: if-map-get($title-publisher-margin-top, $type) if-map-get($title-publisher-margin-right, $type) if-map-get($title-publisher-margin-bottom, $type) if-map-get($title-publisher-margin-left, $type);
Expand All @@ -128,7 +128,7 @@ h4.publisher {
padding-bottom: if-map-get($title-publisher-padding-bottom, $type);
}

h5.publisher-city {
p.publisher-city {
float: if-map-get($title-publisher-city-float, $type);
margin-top: 0;
margin-left: if-map-get($title-publisher-city-margin-left, $type);
Expand Down Expand Up @@ -191,17 +191,17 @@ h5.publisher-city {
font-weight: normal;
}

h3.author {
p.author {
font-style: normal;
font-weight: normal;
}

h4.publisher {
p.publisher {
font-style: normal;
font-weight: normal;
}

h5.publisher-city {
p.publisher-city {
font-style: normal;
font-weight: normal;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
}
}

h2.chapter-subtitle {
p.chapter-subtitle {
display: block;
margin-bottom: 0;
font-family: $section-subtitle-font-family;
Expand All @@ -63,7 +63,7 @@
word-spacing: if-map-get($section-subtitle-word-spacing, $type);
}

h2.chapter-author {
p.chapter-author {
display: block;
margin-bottom: if-map-get($section-author-margin-bottom, $type);
font-family: $section-author-font-family;
Expand All @@ -78,25 +78,25 @@
word-spacing: if-map-get($section-author-word-spacing, $type);
}

h1.back-matter-title + h2.chapter-subtitle,
.short-title + h2.chapter-subtitle {
h1.back-matter-title + p.chapter-subtitle,
.short-title + p.chapter-subtitle {
Copy link
Member

Choose a reason for hiding this comment

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

remove h1 and p references here?

margin-top: if-map-get($section-title-subtitle-spacing, $type);
}

h1.back-matter-title + h2.chapter-author,
.short-title + h2.chapter-author {
h1.back-matter-title + p.chapter-author,
.short-title + p.chapter-author {
Copy link
Member

Choose a reason for hiding this comment

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

remove h1 and p references here?

margin-top: if-map-get($section-title-author-spacing, $type);
}

h2.chapter-subtitle + h2.chapter-author {
p.chapter-subtitle + p.chapter-author {
margin-top: if-map-get($section-subtitle-author-spacing, $type);
}

h1.back-matter-title:last-child {
Copy link
Member

Choose a reason for hiding this comment

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

remove h1 reference here?

margin-bottom: if-map-get($back-matter-title-margin-bottom, $type);
}

h2.chapter-subtitle:last-child {
p.chapter-subtitle:last-child {
margin-bottom: if-map-get($section-subtitle-margin-bottom, $type);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
}
}

h2.chapter-subtitle {
p.chapter-subtitle {
display: block;
margin-bottom: 0;
font-family: $section-subtitle-font-family;
Expand All @@ -99,7 +99,7 @@
word-spacing: if-map-get($section-subtitle-word-spacing, $type);
}

h2.chapter-author {
p.chapter-author {
display: block;
margin-bottom: if-map-get($section-author-margin-bottom, $type);
font-family: $section-author-font-family;
Expand All @@ -114,25 +114,25 @@
word-spacing: if-map-get($section-author-word-spacing, $type);
}

h2.chapter-title + h2.chapter-subtitle,
.short-title + h2.chapter-subtitle {
h2.chapter-title + p.chapter-subtitle,
.short-title + p.chapter-subtitle {
margin-top: if-map-get($section-title-subtitle-spacing, $type);
}

h2.chapter-title + h2.chapter-author,
.short-title + h2.chapter-author {
p.chapter-title + p.chapter-author,
.short-title + p.chapter-author {
margin-top: if-map-get($section-title-author-spacing, $type);
}

h2.chapter-subtitle + h2.chapter-author {
p.chapter-subtitle + p.chapter-author {
margin-top: if-map-get($section-subtitle-author-spacing, $type);
}

h2.chapter-title:last-child {
p.chapter-title:last-child {
margin-bottom: if-map-get($section-title-margin-bottom, $type);
}

h2.chapter-subtitle:last-child {
p.chapter-subtitle:last-child {
margin-bottom: if-map-get($section-subtitle-margin-bottom, $type);
}
}
Expand Down Expand Up @@ -177,7 +177,7 @@ blockquote.aphorism {
margin-bottom: 0;
}

h3.chapter-number {
p.chapter-number {
Copy link
Member

Choose a reason for hiding this comment

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

remove p reference here?

margin-top: 1em;
margin-bottom: 1em;
font-size: 1.2em;
Expand All @@ -195,7 +195,7 @@ blockquote.aphorism {
text-align: center;
}

h2.chapter-subtitle {
p.chapter-subtitle {
margin-top: 0.5em;
margin-bottom: 0.5em;
font-size: 0.9em;
Expand All @@ -204,7 +204,7 @@ blockquote.aphorism {
text-align: center;
}

h2.chapter-author {
p.chapter-author {
margin-top: 0.5em;
margin-bottom: 0.5em;
font-size: 0.8em;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
}
}

h2.chapter-subtitle {
p.chapter-subtitle {
display: block;
margin-bottom: 0;
font-family: $section-subtitle-font-family;
Expand All @@ -63,7 +63,7 @@
word-spacing: if-map-get($section-subtitle-word-spacing, $type);
}

h2.chapter-author {
p.chapter-author {
display: block;
margin-bottom: if-map-get($section-author-margin-bottom, $type);
font-family: $section-author-font-family;
Expand All @@ -78,25 +78,25 @@
word-spacing: if-map-get($section-author-word-spacing, $type);
}

h1.front-matter-title + h2.chapter-subtitle,
.short-title + h2.chapter-subtitle {
h1.front-matter-title + p.chapter-subtitle,
.short-title + p.chapter-subtitle {
margin-top: if-map-get($section-title-subtitle-spacing, $type);
}

h1.front-matter-title + h2.chapter-author,
.short-title + h2.chapter-author {
h1.front-matter-title + p.chapter-author,
.short-title + p.chapter-author {
margin-top: if-map-get($section-title-author-spacing, $type);
}

h2.chapter-subtitle + h2.chapter-author {
p.chapter-subtitle + p.chapter-author {
margin-top: if-map-get($section-subtitle-author-spacing, $type);
}

h1.front-matter-title:last-child {
margin-bottom: if-map-get($front-matter-title-margin-bottom, $type);
}

h2.chapter-subtitle:last-child {
p.chapter-subtitle:last-child {
margin-bottom: if-map-get($section-subtitle-margin-bottom, $type);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@

@if $type == 'epub' {
@media amzn-mobi {
h3.part-number {
p.part-number {
margin-top: 1em;
margin-bottom: 1em;
font-size: 1.3em;
Expand Down
8 changes: 1 addition & 7 deletions packages/buckram/assets/styles/components/toc/_generic.scss
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,7 @@
}

@if $type == 'prince' {
h3.front-matter-number,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not needed anymore https://www.princexml.com/doc/pdf-bookmarks/#bookmark-levels because we are not using a title tag

h3.part-number,
h3.chapter-number,
h3.back-matter-number {
bookmark-level: none;
}


#toc {
display: $toc-display;
counter-reset: part;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div class="chapter standard"
id="chapter-big-images-yes-captions">
<div class="chapter-title-wrap">
<h3 class="chapter-number">3</h3>
<p class="chapter-number">3</p>
<h2 class="chapter-title">Big Images – YES CAPTIONS!</h2>
</div>
<div class="ugc chapter-ugc">
Expand Down