From ca127e987e766bba6e1a30d4372c5e41901073c7 Mon Sep 17 00:00:00 2001 From: Jason Etcovitch Date: Mon, 14 Dec 2020 10:06:03 -0500 Subject: [PATCH] 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> --- includes/release-notes-category-label.html | 9 +-------- includes/release-notes-heading.html | 21 ++++----------------- layouts/release-notes.html | 2 +- lib/render-content/index.js | 8 ++++++++ stylesheets/release-notes.scss | 20 ++++++++++++++++++++ 5 files changed, 34 insertions(+), 26 deletions(-) diff --git a/includes/release-notes-category-label.html b/includes/release-notes-category-label.html index d14441c921..c1b6783196 100644 --- a/includes/release-notes-category-label.html +++ b/includes/release-notes-category-label.html @@ -1,25 +1,18 @@ {% case section[0] %} {% when "features" %} - {% assign colors = "bg-gradient-aquamarine-mauve text-white" %} {% assign text = "Features" %} {% when "bugs" %} - {% assign colors = "bg-gradient-red-orange text-white" %} {% assign text = "Bug fixes" %} {% when "known_issues" %} - {% assign colors = "bg-gradient-dark-mint text-white" %} {% assign text = "Known issues" %} {% when "security_fixes" %} - {% assign colors = "bg-gradient-coral-yellow text-white" %} {% assign text = "Security fixes" %} {% when "changes" %} - {% assign colors = "bg-gradient-blue-purple text-white" %} {% assign text = "Changes" %} {% when "deprecations" %} - {% assign colors = "bg-gradient-mint-blue text-white" %} {% assign text = "Deprecations" %} {% else %} - {% assign colors = "bg-blue text-white" %} {% assign text = "INVALID SECTION" %} {% endcase %} -{{ text }} +{{ text }} diff --git a/includes/release-notes-heading.html b/includes/release-notes-heading.html index dbb2e409c1..44d2553a56 100644 --- a/includes/release-notes-heading.html +++ b/includes/release-notes-heading.html @@ -1,18 +1,5 @@ -{% case section[0] %} - {% when "features" %} - {% assign colors = "text-gradient-aquamarine-mauve" %} - {% when "bugs" %} - {% assign colors = "text-gradient-red-orange" %} - {% when "known_issues" %} - {% assign colors = "text-gradient-dark-mint" %} - {% when "security_fixes" %} - {% assign colors = "text-gradient-coral-yellow-dark" %} - {% when "changes" %} - {% assign colors = "text-gradient-blue-purple" %} - {% when "deprecations" %} - {% assign colors = "text-gradient-dark-mint" %} - {% else %} - {% assign colors = "text-gradient-aquamarine-mauve" %} -{% endcase %} +{% assign slug = note.heading | slugify %} -

{{ note.heading }}

+

+ {{ note.heading }} +

diff --git a/layouts/release-notes.html b/layouts/release-notes.html index daf45e7f11..ace5ac63eb 100644 --- a/layouts/release-notes.html +++ b/layouts/release-notes.html @@ -66,7 +66,7 @@

{{ patch.intro }}

{% for section in patch.sections %} -
+
{% include 'release-notes-category-label' %}
diff --git a/lib/render-content/index.js b/lib/render-content/index.js index 02068459b8..ec964e4c9d 100644 --- a/lib/render-content/index.js +++ b/lib/render-content/index.js @@ -1,3 +1,4 @@ +const GithubSlugger = require('github-slugger') const renderContent = require('./renderContent') const { ExtendedMarkdown, tags } = require('../liquid-tags/extended-markdown') @@ -33,6 +34,13 @@ renderContent.liquid.registerFilters({ */ version_num: (input) => { return input.split('@')[1] + }, + /** + * Convert the input to a slug + */ + slugify: (input) => { + const slugger = new GithubSlugger() + return slugger.slug(input) } }) diff --git a/stylesheets/release-notes.scss b/stylesheets/release-notes.scss index 5ec1cbd7e8..8c46235a7b 100644 --- a/stylesheets/release-notes.scss +++ b/stylesheets/release-notes.scss @@ -15,3 +15,23 @@ ul.release-notes-list li.release-notes-list-item { details[open].release-notes-version-picker summary .octicon.octicon-chevron-down { transform: rotate(180deg); } + +$colors-list:( + features: #05a88b, + bugs: #ec8c1c, + known_issues: #4f6db3, + security_fixes: #e53e72, + changes: #69b378, + deprecations: #9a62a3 +); + +@each $key,$val in $colors-list{ + .release-notes-section-#{$key} { + .release-notes-section-label { + background-color: #{$val}; + } + .release-notes-section-heading { + color: #{$val}; + } + } +}