<commit_before>// Tâmia © 2015 <NAME> http://sapegin.me
// <NAME>
//
// Syntax for OpenType features in CSS:
//   http://help.typekit.com/customer/portal/articles/1789736
// Death to typewriters by Medium. Technical supplement:
//   https://medium.com/@mwichary/death-to-typewriters-technical-supplement-8f3c754626f2

// Enables ligatures on body (just headers otherwise).
richtypo_global_ligatures ?= true

// Extra OpenType features, eg. "ss01", "ss03", "salt" (richtypo_global_ligatures should be enabled).
richtypo_extra_features ?= false

// Figures type: proportional, oldstyle (richtypo_global_ligatures should be enabled).
richtypo_figures ?= "proportional"

// Enables small caps in abbreviations.
richtypo_proper_abbr ?= true

_ligatures = common-ligatures discretionary-ligatures contextual historical-ligatures
_base_features = "kern", "liga", "dlig", "hlig", "clig"
if richtypo_extra_features
	_base_features = _base_features, richtypo_extra_features
if richtypo_figures == "proportional"
	_base_features = _base_features, "pnum"
	_figures_variant = "proportional-nums"
else if richtypo_figures == "oldstyle"
	_base_features = _base_features, "onum"
	_figures_variant = "oldstyle-nums"

// Global font settings.
if richtypo_global_ligatures
	body
		font-kerning: normal
		font-variant-numeric: _figures_variant
		font-variant-ligatures: _ligatures
		font-feature-settings: _base_features

	.table,
	code,
	pre
		font-variant-numeric: tabular-nums
		font-variant-ligatures: none
		font-feature-settings: "thum"

// Abbreviations with spacing.
.abbr,
.text abbr
	letter-spacing: 0.1em
	margin-right: -0.1em
	if richtypo_proper_abbr
		font-variant-caps: all-small-caps
		font-feature-settings: _base_features, "c2sc", "smcp"

// The best ampersand.
.amp
	font-family: Baskerville, Constantia, Palatino, "Palatino Linotype", "Book Antiqua", serif
	font-style: italic

// Hanging punctuation.
.sbrace
	margin-right: 0.3em
.hbrace
	margin-left: -0.3em
.slaquo
	margin-right: 0.42em
.hlaquo
	margin-left: -0.42em

// Headings with ligatures.
if not richtypo_global_ligatures
	.text h1, .alpha,
	.text h2, .beta,
	.text h3, .gamma,
	.text h4, .delta,
	.text h5, .epsilon,
	.text h6, .zeta
		font-variant-ligatures: _ligatures
		font-feature-settings: _base_features<commit_msg>Update hanging punctuation rules for Richtypo 1.0.<commit_after>// Tâmia © 2015 <NAME> http://sapegin.me
// <NAME>
//
// Syntax for OpenType features in CSS:
//   http://help.typekit.com/customer/portal/articles/1789736
// Death to typewriters by Medium. Technical supplement:
//   https://medium.com/@mwichary/death-to-typewriters-technical-supplement-8f3c754626f2

// Enables ligatures on body (just headers otherwise).
richtypo_global_ligatures ?= true

// Extra OpenType features, eg. "ss01", "ss03", "salt" (richtypo_global_ligatures should be enabled).
richtypo_extra_features ?= false

// Figures type: proportional, oldstyle (richtypo_global_ligatures should be enabled).
richtypo_figures ?= "proportional"

// Enables small caps in abbreviations.
richtypo_proper_abbr ?= true

_ligatures = common-ligatures discretionary-ligatures contextual historical-ligatures
_base_features = "kern", "liga", "dlig", "hlig", "clig"
if richtypo_extra_features
	_base_features = _base_features, richtypo_extra_features
if richtypo_figures == "proportional"
	_base_features = _base_features, "pnum"
	_figures_variant = "proportional-nums"
else if richtypo_figures == "oldstyle"
	_base_features = _base_features, "onum"
	_figures_variant = "oldstyle-nums"

// Global font settings.
if richtypo_global_ligatures
	body
		font-kerning: normal
		font-variant-numeric: _figures_variant
		font-variant-ligatures: _ligatures
		font-feature-settings: _base_features

	.table,
	code,
	pre
		font-variant-numeric: tabular-nums
		font-variant-ligatures: none
		font-feature-settings: "thum"

// Abbreviations with spacing.
.abbr,
.text abbr
	letter-spacing: 0.1em
	margin-right: -0.1em
	if richtypo_proper_abbr
		font-variant-caps: all-small-caps
		font-feature-settings: _base_features, "c2sc", "smcp"

// The best ampersand.
.amp
	font-family: Baskerville, Constantia, Palatino, "Palatino Linotype", "Book Antiqua", serif
	font-style: italic

// Hanging punctuation.
.sbrace
	margin-right: 0.3em
.hbrace
	margin-left: -0.3em
.slaquo
	margin-right: 0.42em
.hlaquo
	margin-left: -0.42em
.sbdquo
	margin-right: 0.42em
.hbdquo
	margin-left: -0.42em
.sldquo
	margin-right: 0.42em
.hldquo
	margin-left: -0.42em
.slsquo
	margin-right: 0.42em
.hlsquo
	margin-left: -0.42em

// Headings with ligatures.
if not richtypo_global_ligatures
	.text h1, .alpha,
	.text h2, .beta,
	.text h3, .gamma,
	.text h4, .delta,
	.text h5, .epsilon,
	.text h6, .zeta
		font-variant-ligatures: _ligatures
		font-feature-settings: _base_features
{'fraction_non_alphanumeric': 0.11524785609705082, 'fraction_numerical': 0.02300773896674336, 'mean_word_length': 4.471395881006865, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6059283', 'n_tokens_mistral': 1886, 'n_tokens_neox': 1753, 'n_words': 407}