Skip to content

Commit

Permalink
Style glossary outputs (fix #320) (#361)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ned Zimmerman authored Nov 13, 2018
1 parent bf90323 commit d583abd
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 24 deletions.
12 changes: 0 additions & 12 deletions assets/styles/components/_elements.scss
Original file line number Diff line number Diff line change
Expand Up @@ -165,18 +165,6 @@ $ul-margin-bottom: (20 / 14) * 1em !default;
$ul-margin-left: 0 !default;
$ul-padding-left: 2em !default;
$li-li-margin-top: 0 !default;
$dt-margin-top: 0 !default;
$dt-margin-right: 0 !default;
$dt-margin-bottom: 0 !default;
$dt-margin-left: 0 !default;
$dt-font-style: normal !default;
$dt-font-weight: bold !default;
$dd-margin-top: 0 !default;
$dd-margin-right: 0 !default;
$dd-margin-bottom: 0 !default;
$dd-margin-left: 0 !default;
$dd-font-style: italic !default;
$dd-font-weight: normal !default;

//Tables
$table-margin-top: 1.5em !default;
Expand Down
33 changes: 31 additions & 2 deletions packages/buckram/assets/styles/components/elements/_lists.scss
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,26 @@

%dt {
display: block;
margin: $dt-margin-top $dt-margin-right $dt-margin-bottom $dt-margin-left;
margin:
if-map-get($dt-margin-top, $type)
if-map-get($dt-margin-right, $type)
if-map-get($dt-margin-bottom, $type)
if-map-get($dt-margin-left, $type);
font-style: $dt-font-style;
font-weight: $dt-font-weight;
}

%dfn {
font-style: $dt-font-style;
font-weight: $dt-font-weight;
}

%dd {
margin: $dd-margin-top $dd-margin-right $dd-margin-bottom $dd-margin-left;
margin:
if-map-get($dd-margin-top, $type)
if-map-get($dd-margin-right, $type)
if-map-get($dd-margin-bottom, $type)
if-map-get($dd-margin-left, $type);
font-style: $dd-font-style;
font-weight: $dd-font-weight;
}
Expand Down Expand Up @@ -282,9 +295,17 @@
@extend %dt;
}

dl dt dfn {
@extend %dfn;
}

dl dd {
@extend %dd;
}

dd + dt {
margin-top: $dd-dt-spacing;
}
} @else {
.front-matter,
.part,
Expand Down Expand Up @@ -322,9 +343,17 @@
@extend %dt;
}

dl dt dfn {
@extend %dfn;
}

dl dd {
@extend %dd;
}

dd + dt {
margin-top: $dd-dt-spacing;
}
}

@if $type == "epub" {
Expand Down
25 changes: 15 additions & 10 deletions packages/buckram/assets/styles/variables/_elements.scss
Original file line number Diff line number Diff line change
Expand Up @@ -815,19 +815,19 @@ $ol-ol-margin-top: 0.5em !default;
$ul-ul-margin-top: 0.5em !default;

/// Top margin for `<dt>` elements.
/// @type String
/// @type String | Map
$dt-margin-top: 0 !default;

/// Right margin for `<dt>` elements.
/// @type String
/// @type String | Map
$dt-margin-right: 0 !default;

/// Bottom margin for `<dt>` elements.
/// @type String
/// @type String | Map
$dt-margin-bottom: 0 !default;

/// Left margin for `<dt>` elements.
/// @type String
/// @type String | Map
$dt-margin-left: 0 !default;

/// Font style for `<dt>` elements.
Expand All @@ -838,25 +838,30 @@ $dt-font-style: normal !default;
/// @type String
$dt-font-weight: bold !default;

/// Spacing between a `<dt>` element and the subsequent `<dt>` element.
/// @since 1.2.0
/// @type String | Map
$dd-dt-spacing: 1em !default;

/// Top margin for `<dd>` elements.
/// @type String
/// @type String | Map
$dd-margin-top: 0 !default;

/// Right margin for `<dd>` elements.
/// @type String
/// @type String | Map
$dd-margin-right: 0 !default;

/// Bottom margin for `<dd>` elements.
/// @type String
/// @type String | Map
$dd-margin-bottom: 0 !default;

/// Left margin for `<dd>` elements.
/// @type String
$dd-margin-left: 0 !default;
/// @type String | Map
$dd-margin-left: (epub: 0, prince: 2em, web: 0) !default;

/// Font style for `<dd>` elements.
/// @type String
$dd-font-style: italic !default;
$dd-font-style: normal !default;

/// Font weight for `<dd>` elements.
/// @type String
Expand Down

0 comments on commit d583abd

Please sign in to comment.