Skip to content

Commit ca127e9

Browse files
Change release notes colors (#16923)
* Use pastel colors * Whit text * Slugify/anchor section headings * Use classes instead of style attributes * Use fancy-pants SCSS * Simplify a tad * TIL text-inherit helper Co-authored-by: Vanessa Yuen <6842965+vanessayuenn@users.noreply.github.com> * Remove redundant `style` attr Co-authored-by: Vanessa Yuen <6842965+vanessayuenn@users.noreply.github.com> Co-authored-by: Vanessa Yuen <6842965+vanessayuenn@users.noreply.github.com>
1 parent 432742c commit ca127e9

5 files changed

Lines changed: 34 additions & 26 deletions

File tree

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,18 @@
11
{% case section[0] %}
22
{% when "features" %}
3-
{% assign colors = "bg-gradient-aquamarine-mauve text-white" %}
43
{% assign text = "Features" %}
54
{% when "bugs" %}
6-
{% assign colors = "bg-gradient-red-orange text-white" %}
75
{% assign text = "Bug fixes" %}
86
{% when "known_issues" %}
9-
{% assign colors = "bg-gradient-dark-mint text-white" %}
107
{% assign text = "Known issues" %}
118
{% when "security_fixes" %}
12-
{% assign colors = "bg-gradient-coral-yellow text-white" %}
139
{% assign text = "Security fixes" %}
1410
{% when "changes" %}
15-
{% assign colors = "bg-gradient-blue-purple text-white" %}
1611
{% assign text = "Changes" %}
1712
{% when "deprecations" %}
18-
{% assign colors = "bg-gradient-mint-blue text-white" %}
1913
{% assign text = "Deprecations" %}
2014
{% else %}
21-
{% assign colors = "bg-blue text-white" %}
2215
{% assign text = "INVALID SECTION" %}
2316
{% endcase %}
2417

25-
<span class="{{ colors }} px-3 py-2 f5 text-uppercase text-mono">{{ text }}</span>
18+
<span class="px-3 py-2 f5 text-uppercase text-mono text-white release-notes-section-label">{{ text }}</span>
Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,5 @@
1-
{% case section[0] %}
2-
{% when "features" %}
3-
{% assign colors = "text-gradient-aquamarine-mauve" %}
4-
{% when "bugs" %}
5-
{% assign colors = "text-gradient-red-orange" %}
6-
{% when "known_issues" %}
7-
{% assign colors = "text-gradient-dark-mint" %}
8-
{% when "security_fixes" %}
9-
{% assign colors = "text-gradient-coral-yellow-dark" %}
10-
{% when "changes" %}
11-
{% assign colors = "text-gradient-blue-purple" %}
12-
{% when "deprecations" %}
13-
{% assign colors = "text-gradient-dark-mint" %}
14-
{% else %}
15-
{% assign colors = "text-gradient-aquamarine-mauve" %}
16-
{% endcase %}
1+
{% assign slug = note.heading | slugify %}
172

18-
<h4 class="{{ colors }} text-uppercase text-bold">{{ note.heading }}</h4>
3+
<h4 id="{{ slug }}" class="release-notes-section-heading text-uppercase text-bold">
4+
<a href="#{{ slug }}" class="text-inherit">{{ note.heading }}</a>
5+
</h4>

layouts/release-notes.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ <h2 class="d-flex flex-items-center border-bottom-0 mr-3 mb-0">
6666
<p class="mt-3">{{ patch.intro }}</p>
6767

6868
{% for section in patch.sections %}
69-
<div class="py-6 d-block d-xl-flex flex-items-baseline {% unless forloop.last %}border-bottom{% endunless %}">
69+
<div class="release-notes-section-{{ section[0] }} py-6 d-block d-xl-flex flex-items-baseline {% unless forloop.last %}border-bottom{% endunless %}">
7070
<div class="mr-2 flex-shrink-0 mb-5 col-12 col-xl-3">
7171
{% include 'release-notes-category-label' %}
7272
</div>

lib/render-content/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const GithubSlugger = require('github-slugger')
12
const renderContent = require('./renderContent')
23
const { ExtendedMarkdown, tags } = require('../liquid-tags/extended-markdown')
34

@@ -33,6 +34,13 @@ renderContent.liquid.registerFilters({
3334
*/
3435
version_num: (input) => {
3536
return input.split('@')[1]
37+
},
38+
/**
39+
* Convert the input to a slug
40+
*/
41+
slugify: (input) => {
42+
const slugger = new GithubSlugger()
43+
return slugger.slug(input)
3644
}
3745
})
3846

stylesheets/release-notes.scss

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,23 @@ ul.release-notes-list li.release-notes-list-item {
1515
details[open].release-notes-version-picker summary .octicon.octicon-chevron-down {
1616
transform: rotate(180deg);
1717
}
18+
19+
$colors-list:(
20+
features: #05a88b,
21+
bugs: #ec8c1c,
22+
known_issues: #4f6db3,
23+
security_fixes: #e53e72,
24+
changes: #69b378,
25+
deprecations: #9a62a3
26+
);
27+
28+
@each $key,$val in $colors-list{
29+
.release-notes-section-#{$key} {
30+
.release-notes-section-label {
31+
background-color: #{$val};
32+
}
33+
.release-notes-section-heading {
34+
color: #{$val};
35+
}
36+
}
37+
}

0 commit comments

Comments
 (0)