From b183c6fb0fb62f322699b9bdf196ffa516bc7db9 Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Mon, 30 Sep 2019 11:46:12 -0700 Subject: [PATCH 1/7] npm version 14.0.0 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index d9b1f96933..fdaa517fe1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@primer/css", - "version": "13.0.2", + "version": "14.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 132200f1d9..9f8a0b6e2b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@primer/css", - "version": "13.0.2", + "version": "14.0.0", "description": "Primer is the CSS framework that powers GitHub's front-end design. primer includes 23 packages that are grouped into 3 core meta-packages for easy install. Each package and meta-package is independently versioned and distributed via npm, so it's easy to include all or part of Primer within your own project.", "homepage": "https://primer.style/css", "author": "GitHub, Inc.", From 90756936981c1060101a88d244de798d80658da8 Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Mon, 30 Sep 2019 14:32:44 -0700 Subject: [PATCH 2/7] convert markdown page to one big example --- docs/content/components/markdown.md | 427 +++++++++++++++++----------- 1 file changed, 267 insertions(+), 160 deletions(-) diff --git a/docs/content/components/markdown.md b/docs/content/components/markdown.md index b65b2dfe5c..698cc13818 100644 --- a/docs/content/components/markdown.md +++ b/docs/content/components/markdown.md @@ -7,168 +7,275 @@ bundle: markdown --- -Text can be **bold**, _italic_, or ~~strikethrough~~. [Links](https://github.com) should be blue with no underlines (unless hovered over). +```html live +
+

Text can be bold, italic, or strikethrough. Links should be blue with no underlines (unless hovered over).

-There should be whitespace between paragraphs. There should be whitespace between paragraphs. There should be whitespace between paragraphs. There should be whitespace between paragraphs. +

There should be whitespace between paragraphs. There should be whitespace between paragraphs. There should be whitespace between paragraphs. There should be whitespace between paragraphs.

-There should be whitespace between paragraphs. There should be whitespace between paragraphs. There should be whitespace between paragraphs. There should be whitespace between paragraphs. +

There should be whitespace between paragraphs. There should be whitespace between paragraphs. There should be whitespace between paragraphs. There should be whitespace between paragraphs.

-> There should be no margin above this first sentence. -> -> Blockquotes should be a lighter gray with a gray border along the left side. -> -> There should be no margin below this final sentence. +
+

There should be no margin above this first sentence.

+

Blockquotes should be a lighter gray with a gray border along the left side.

+

There should be no margin below this final sentence.

+
-# Header 1 - -This is a normal paragraph following a header. Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong. - -## Header 2 - -> This is a blockquote following a header. Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong. - -### Header 3 - -``` -This is a code block following a header. -``` - -#### Header 4 - -* This is an unordered list following a header. -* This is an unordered list following a header. -* This is an unordered list following a header. - -##### Header 5 - -1. This is an ordered list following a header. -2. This is an ordered list following a header. -3. This is an ordered list following a header. - -###### Header 6 - -| What | Follows | -|-----------|-----------------| -| A table | A header | -| A table | A header | -| A table | A header | - ----------------- - -There's a horizontal rule above and below this. - ----------------- - -Here is an unordered list: - -* Salt-n-Pepa -* Bel Biv DeVoe -* Kid 'N Play - -And an ordered list: - -1. Michael Jackson -2. Michael Bolton -3. Michael Bublé - -And an unordered task list: - -- [x] Create a sample markdown document -- [x] Add task lists to it -- [ ] Take a vacation - -And a "mixed" task list: - -- [ ] Steal underpants -- ? -- [ ] Profit! - -And a nested list: - -* Jackson 5 - * Michael - * Tito - * Jackie - * Marlon - * Jermaine -* TMNT - * Leonardo - * Michelangelo - * Donatello - * Raphael - -Definition lists can be used with HTML syntax. Definition terms are bold and italic. - -
-
Name
-
Godzilla
-
Born
-
1952
-
Birthplace
-
Japan
-
Color
-
Green
-
- ----------------- - -Tables should have bold headings and alternating shaded rows. - -| Artist | Album | Year | -|-------------------|-----------------|------| -| Michael Jackson | Thriller | 1982 | -| Prince | Purple Rain | 1984 | -| Beastie Boys | License to Ill | 1986 | - -If a table is too wide, it should condense down and/or scroll horizontally. - -| Artist | Album | Year | Label | Awards | Songs | -|-------------------|-----------------|------|-------------|----------|-----------| -| Michael Jackson | Thriller | 1982 | Epic Records | Grammy Award for Album of the Year, American Music Award for Favorite Pop/Rock Album, American Music Award for Favorite Soul/R&B Album, Brit Award for Best Selling Album, Grammy Award for Best Engineered Album, Non-Classical | Wanna Be Startin' Somethin', Baby Be Mine, The Girl Is Mine, Thriller, Beat It, Billie Jean, Human Nature, P.Y.T. (Pretty Young Thing), The Lady in My Life | -| Prince | Purple Rain | 1984 | Warner Brothers Records | Grammy Award for Best Score Soundtrack for Visual Media, American Music Award for Favorite Pop/Rock Album, American Music Award for Favorite Soul/R&B Album, Brit Award for Best Soundtrack/Cast Recording, Grammy Award for Best Rock Performance by a Duo or Group with Vocal | Let's Go Crazy, Take Me With U, The Beautiful Ones, Computer Blue, Darling Nikki, When Doves Cry, I Would Die 4 U, Baby I'm a Star, Purple Rain | -| Beastie Boys | License to Ill | 1986 | Mercury Records | noawardsbutthistablecelliswide | Rhymin & Stealin, The New Style, She's Crafty, Posse in Effect, Slow Ride, Girls, (You Gotta) Fight for Your Right, No Sleep Till Brooklyn, Paul Revere, Hold It Now, Hit It, Brass Monkey, Slow and Low, Time to Get Ill | - ----------------- - -Code snippets like `var foo = "bar";` can be shown inline. - -Also, `this should vertically align` ~~`with this`~~ ~~and this~~. - -Code can also be shown in a block element. -``` -var foo = "bar"; -``` - -Code can also use syntax highlighting. -```javascript -var foo = "bar"; -``` - -``` -Long, single-line code blocks should not wrap. They should horizontally scroll if they are too long. This line should be long enough to demonstrate this. -``` - -```javascript -var foo = "The same thing is true for code with syntax highlighting. A single line of code should horizontally scroll if it is really long."; -``` - -Inline code inside table cells should still be distinguishable. - -| Language | Code | -|-------------|--------------------| -| Javascript | `var foo = "bar";` | -| Ruby | `foo = "bar"` | - ----------------- - -Small images should be shown at their actual size. - -![](http://placekitten.com/g/300/200/) - -Large images should always scale down and fit in the content container. - -![](http://placekitten.com/g/1200/800/) - -``` -This is the final element on the page and there should be no margin below this. +

Header 1

+ +

This is a normal paragraph following a header. Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong.

+ +

Header 2

+ +
This is a blockquote following a header. Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong.
+ +

Header 3

+ +
This is a code block following a header.
+ +

Header 4

+ +
    +
  • This is an unordered list following a header.
  • +
  • This is an unordered list following a header.
  • +
  • This is an unordered list following a header.
  • +
+ +
Header 5
+ +
    +
  1. This is an ordered list following a header.
  2. +
  3. This is an ordered list following a header.
  4. +
  5. This is an ordered list following a header.
  6. +
+ +
Header 6
+ + + + + + + + + + + + + + + + + + + + + + +
WhatFollows
A tableA header
A tableA header
A tableA header
+ +
+ +

There's a horizontal rule above and below this.

+ +
+ +

Here is an unordered list:

+ +
    +
  • Salt-n-Pepa
  • +
  • Bel Biv DeVoe
  • +
  • Kid 'N Play
  • +
+ +

And an ordered list:

+ +
    +
  1. Michael Jackson
  2. +
  3. Michael Bolton
  4. +
  5. Michael Bublé
  6. +
+ +

And an unordered task list:

+ +
    +
  • Create a sample markdown document
  • +
  • Add task lists to it
  • +
  • Take a vacation
  • +
+ +

And a "mixed" task list:

+ +
    +
  • Steal underpants
  • +
  • ?
  • +
  • Profit!
  • +
+ + And a nested list: + +
    +
  • Jackson 5 +
      +
    • Michael
    • +
    • Tito
    • +
    • Jackie
    • +
    • Marlon
    • +
    • Jermaine
    • +
    +
  • +
  • TMNT +
      +
    • Leonardo
    • +
    • Michelangelo
    • +
    • Donatello
    • +
    • Raphael
    • +
    +
  • +
+ +

Definition lists can be used with HTML syntax. Definition terms are bold and italic.

+ +
+
Name
+
Godzilla
+
Born
+
1952
+
Birthplace
+
Japan
+
Color
+
Green
+
+ +
+ +

Tables should have bold headings and alternating shaded rows.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ArtistAlbumYear
David BowieScary Monsters1980
PrincePurple Rain1982
Beastie BoysLicense to Ill1986
Janet JacksonRhythm Nation 18141989
+ +

If a table is too wide, it should condense down and/or scroll horizontally.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ArtistAlbumYearLabelSongs
David BowieScary Monsters1980RCA RecordsIt's No Game (No. 1), Up the Hill Backwards, Scary Monsters (And Super Creeps), Ashes to Ashes, Fashion, Teenage Wildlife, Scream Like a Baby, Kingdom Come, Because You're Young, It's No Game (No. 2)
PrincePurple Rain1982Warner Brothers RecordsLet's Go Crazy, Take Me With U, The Beautiful Ones, Computer Blue, Darling Nikki, When Doves Cry, I Would Die 4 U, Baby I'm a Star, Purple Rain
Beastie BoysLicense to Ill1986Def JamRhymin & Stealin, The New Style, She's Crafty, Posse in Effect, Slow Ride, Girls, Fight for Your Right, No Sleep till Brooklyn, Paul Revere, "Hold It Now, Hit It", Brass Monkey, Slow and Low, Time to Get Ill
Janet JacksonRhythm Nation 18141989A&MInterlude: Pledge, Rhythm Nation, Interlude: T.V., State of the World, Interlude: Race, The Knowledge, Interlude: Let's Dance, Miss You Much, Interlude: Come Back, Love Will Never Do (Without You), Livin' in a World (They Didn't Make), Alright, Interlude: Hey Baby, Escapade, Interlude: No Acid, Black Cat, Lonely, Come Back to Me, Someday Is Tonight, Interlude: Livin'...In Complete Darkness
+ +
+ +

Code snippets like var foo = "bar"; can be shown inline.

+ +

Also, this should vertically align with this and this.

+ +

Code can also be shown in a block element.

+ +
var foo = "bar";
+ +

Code can also use syntax highlighting.

+ +
var foo = "bar";
+ +
Long, single-line code blocks should not wrap. They should horizontally scroll if they are too long. This line should be long enough to demonstrate this.
+ +
var foo = "The same thing is true for code with syntax highlighting. A single line of code should horizontally scroll if it is really long.";
+ +

Inline code inside table cells should still be distinguishable.

+ + + + + + + + + + + + + + + + + + +
LanguageCode
JavasScriptvar foo = "bar";
Rubyfoo = "bar"
+ +
+ +

Small images should be shown at their actual size.

+ +

+ +

Large images should always scale down and fit in the content container.

+ +

+ +
This is the final element on the page and there should be no margin below this.
+
``` From ae81f41ed113e0f0053cd47484a3f5150957ca95 Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Mon, 30 Sep 2019 14:35:41 -0700 Subject: [PATCH 3/7] nix display: block; width: 100% on markdown tables --- src/markdown/tables.scss | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/markdown/tables.scss b/src/markdown/tables.scss index 1f48119eab..4a189356b6 100644 --- a/src/markdown/tables.scss +++ b/src/markdown/tables.scss @@ -3,8 +3,6 @@ .markdown-body { // Tables table { - display: block; - width: 100%; overflow: auto; th { From 7dad0ee8aec282bb60ea0cb80b8a3679163cb3b4 Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Mon, 30 Sep 2019 14:36:00 -0700 Subject: [PATCH 4/7] use variables in markdown tables scss --- src/markdown/tables.scss | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/markdown/tables.scss b/src/markdown/tables.scss index 4a189356b6..166a677054 100644 --- a/src/markdown/tables.scss +++ b/src/markdown/tables.scss @@ -11,13 +11,12 @@ th, td { - padding: 6px 13px; - border: 1px solid lighten($gray-300, 5%); + padding: ($spacer-2 - 2) ($spacer-3 - 2); + border: $border-width $border-style $border-gray-dark; } tr { background-color: $bg-white; - border-top: 1px solid darken($gray-300, 4%); &:nth-child(2n) { background-color: $gray-100; From 0b522f89164dda985e661e5b47ed6300d2bb40d1 Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Tue, 5 Nov 2019 14:37:22 -0800 Subject: [PATCH 5/7] use "standard" border on table cells --- src/markdown/tables.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/markdown/tables.scss b/src/markdown/tables.scss index 166a677054..cc61bf0794 100644 --- a/src/markdown/tables.scss +++ b/src/markdown/tables.scss @@ -12,7 +12,7 @@ th, td { padding: ($spacer-2 - 2) ($spacer-3 - 2); - border: $border-width $border-style $border-gray-dark; + border: $border; } tr { From d11e64dcd822cb80b39300a47a66cd2486b75b41 Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Tue, 5 Nov 2019 14:39:11 -0800 Subject: [PATCH 6/7] delete "overflow: auto" on .markdown-body table --- src/markdown/tables.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/src/markdown/tables.scss b/src/markdown/tables.scss index cc61bf0794..716dad1bb8 100644 --- a/src/markdown/tables.scss +++ b/src/markdown/tables.scss @@ -3,7 +3,6 @@ .markdown-body { // Tables table { - overflow: auto; th { font-weight: $font-weight-bold; From a0a99c88b16e1f6d4d9862fbbc3640ac8c0eb3c6 Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Tue, 5 Nov 2019 14:42:36 -0800 Subject: [PATCH 7/7] lint: delete empty line --- src/markdown/tables.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/src/markdown/tables.scss b/src/markdown/tables.scss index 716dad1bb8..1a016d4596 100644 --- a/src/markdown/tables.scss +++ b/src/markdown/tables.scss @@ -3,7 +3,6 @@ .markdown-body { // Tables table { - th { font-weight: $font-weight-bold; }