Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add marketing buttons to primer-marketing-buttons #337

Merged
merged 24 commits into from
Nov 7, 2017

Conversation

gladwearefriends
Copy link
Contributor

@gladwearefriends gladwearefriends commented Sep 6, 2017

Testing on github/github here https://github.com/github/github/pull/81105 with the marketing buttons styles removed too.
Deployed onto review lab: https://testing-marketing-buttons-primer.review-lab.github.com/home

To test on review-lab, you can slap these classes onto one of the buttons on the homepage to test:

.btn-orange
.btn-outline-green
.btn-transparent
.btn-large

This has also been tested in StoryBook.

This PR needs to be deployed after Primer 10 is released https://github.com/github/github/pull/81106


This isn't in primer yet! https://github.com/github/github/blob/master/app/assets/stylesheets/custom/site/buttons.scss

Not sure if its related but i remembered this because I was checking out the style guide and the outline styles didnt load
https://styleguide.github.com/primer/components/marketing-buttons/

First time contributing 😬 Let me know if I did that right or not please!

/cc @primer/ds-core

@gladwearefriends
Copy link
Contributor Author

I'll open a PR to delete from github/github once I get the 👍

Copy link
Member

@broccolini broccolini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @gladwearefriends thanks for doing this! Adding these were actually on my ship list for Primer v10 so you've done some of the work for me 😄

There are a few more steps for including new modules in Primer though, if you can start with the feedback I've given here, I'll help you with the next steps when you're ready!

@@ -0,0 +1,91 @@
# Primer Marketing CSS Typography
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you copy+pasted the README for marketing Typography. The Docs for marketing buttons are mostly done and live in github so you can copy that over, (long story but someone started creating a package but didn't actually add it to Primer lol), but not all the buttons you're adding here are in there, such as btn-transparent and btn-blurple—though I'd like to question the use of that button and/or a more sensible name before merging this in.

@@ -0,0 +1,91 @@
# Primer Marketing CSS Typography

[![npm version](http://img.shields.io/npm/v/primer-marketing-type.svg)](https://www.npmjs.org/package/primer-marketing-type)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll need to update these urls to primer-marketing-buttons.

[![npm version](http://img.shields.io/npm/v/primer-marketing-type.svg)](https://www.npmjs.org/package/primer-marketing-type)
[![Build Status](https://travis-ci.org/primer/primer-css.svg?branch=master)](https://travis-ci.org/primer/primer-css)

> Flash messages, or alerts, inform users of successful or pending actions. Use them sparingly. Don’t show more than one at a time.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this description should be for marketing buttons too... now going to check if this description is in marketing typography O_o

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so it should be in marketing buttons? it was copied and pasted from marketing type. i just copy and pasted the message from primer-buttons instead.

@@ -0,0 +1,42 @@
{
"version": "1.3.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version number should be 0.0.1 until we're ready to ship.

"main": "build/index.js",
"primer": {
"category": "marketing",
"module_type": "utilities"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

module_type should be components.

"lib",
"build"
],
"repository": "https://github.com/primer/primer-css/tree/master/modules/primer-marketing-type",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll need to update the url to primer-marketing-buttons.

Copy link
Contributor

@shawnbot shawnbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgive me if this wasn't ready to go, but I noticed a bunch of stuff that was carried over from the marketing-type package.

@@ -0,0 +1,91 @@
# Primer Marketing CSS Typography
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Typography" should be "Buttons" here, right?

@@ -0,0 +1,91 @@
# Primer Marketing CSS Typography

[![npm version](http://img.shields.io/npm/v/primer-marketing-type.svg)](https://www.npmjs.org/package/primer-marketing-type)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, you can probably/safely search for "marketing-type" and replace with "marketing-buttons".

## Documentation

<!-- %docs
title: Typography
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Marketing Buttons"?

status: New Release
-->

The typography for our marketing pages differs slightly from what is in Primer's core--it is responsive, on a slightly different scale, and headlines are in a different font (Roboto).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything between the <!-- %docs and <!-- %enddocs --> markers should be updated with buttons docs.

"main": "build/index.js",
"primer": {
"category": "marketing",
"module_type": "utilities"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be components; at least, that's how we have it in the style guide right now.

@@ -0,0 +1,42 @@
{
"version": "1.3.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should start at 0.0.1, but @broccolini can probably suggest a more appropriate version number since this package is probably more "mature".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When this is ready to ship we can bump to major, but I think we should do that in the v10 pr.

@@ -16,6 +16,7 @@

// marketing specific css modules
@import "primer-marketing-type/index.scss";
@import "primer-marketing-buttons/index.scss";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order for this to work, we'll also need to add this to the dependencies list in modules/primer-marketing/package.json. You should use the same version as you provide in this module's package.json.

@broccolini broccolini added the v10 label Sep 6, 2017
@broccolini broccolini mentioned this pull request Sep 6, 2017
28 tasks
.btn-outline-green { @include btn-outline($green); }

@mixin btn-transparent-active {
color: #333;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to add, can you replace the hex values with new color variables? We also have variables for line-height, border, and border-radius too (for use further down in btn-transparent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@broccolini will do! im actually going to remove a few declarations underbtn-transparent on second thought a lot of these should be inherited from .btn already

.btn-transparent {
padding: 0.55em 1em;
font-size: inherit;
font-weight: 500; // to avoid faux-bolding
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious about what "faux-bolding" means, we've updated all our font-weights to bold (600), or normal (400) in most other places. If we do need it, you can use the $font-weight-semibold variable instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i also just remembered a few of these styles from github/github (where i copied them over from) were declared specifically for an instance where .btn-transparent was used on the marketing homepage. ive removed the font-weight, font-size, padding, line-height, and border-radius as they should be inherited from .btn or the other btn size classes, e.g. .btn-large

@gladwearefriends
Copy link
Contributor Author

gladwearefriends commented Sep 7, 2017

i made updates!

  • simplified btn-transparent declarations to fall back on .btn styles. from a comment i posted for @broccolini

i also just remembered a few of these styles from github/github (where i copied them over from) were declared specifically for an instance where .btn-transparent was used on the marketing homepage. ive removed the font-weight, font-size, padding, line-height, and border-radius as they should be inherited from .btn or the other btn size classes, e.g. .btn-large

  • i noticed primer-marketing-support isnt needed as a dependency for primer-marketing-buttons and took that out.
  • i also moved .btn-large from the primer-buttons module into primer-marketing-buttons as well as it looks like large should only be used on marketing? that change kind of scares me if others are already using btn-large from primer-buttons.
  • updated primer-marketing-buttons readme to reflect these changes

let me know if im approaching all of these things correctly! appreciate the pointers 🙏

@shawnbot
Copy link
Contributor

Hey @gladwearefriends, I can help you wrap this up this week.

@shawnbot shawnbot changed the base branch from dev to release-10.0.0 September 22, 2017 20:39
@shawnbot
Copy link
Contributor

FYI, I've changed the base branch to merge this into our v10 release branch. @broccolini, can you re-review this?

@@ -42,6 +42,7 @@
"primer-layout": "1.3.0",
"primer-markdown": "3.6.0",
"primer-marketing": "5.3.1",
"primer-marketing-buttons": "0.0.1",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

testing

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

testing testing

Copy link
Member

@jonrohan jonrohan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great to me 💯

@gladwearefriends
Copy link
Contributor Author

gladwearefriends commented Nov 3, 2017

Testing on github/github here https://github.com/github/github/pull/81105

@gladwearefriends
Copy link
Contributor Author

Related PR that needs to be deployed in github/github after Primer 10 is released https://github.com/github/github/pull/81106

This pr removes the styles that are now moved into the primer-marketing package under primer-marketing-buttons

Copy link
Member

@broccolini broccolini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this @gladwearefriends 💖

Requesting documentation changes and questions about usage.

CHANGELOG.md Outdated
@@ -5,10 +5,12 @@
- Importing `.input-group` into `primer-forms` module.
- New module `primer-branch-name` "A nice, consistent way to display branch names."
- New module `primer-dropdown` "A lightweight context menu for navigation and actions."
- New module `primer-marketing-buttons`. Buttons for marketing websites at GitHub
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're going to get mad merge conflicts in the v10 branch if everyone updates the changelog (hadn't thought of this before), can you remove the changes here and just add a comment to your pr with "To be included in the Changelog" so we can copy the updates over.

@@ -88,13 +88,6 @@
line-height: 20px;
}

// Large button adds more padding around text. Use font-size utils to increase font-size.. e.g, <p class="text-gamma"><button class="btn btn-large btn-primary" type="button">Big green button</button></p>
.btn-large {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is used in some locations outside of /site/ directory - are you sure this is not needed for product? I think there are some instances of people using utilities to make buttons larger too. One location I can think of is the dashboard banner when you are a new user - easiest way to see this is to run the dev environment locally.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im moving btn-large back into primer core here! not sure why i moved it into marketing-buttons other than i thought it was only used on marketing pages 🤷🏻‍♀️

@@ -41,6 +41,7 @@
"primer-labels": "1.5.1",
"primer-layout": "1.4.1",
"primer-markdown": "3.7.1",
"primer-marketing-buttons": "0.0.1",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to change this to 1.0.0 after merging into v10 branch and run bump script. cc @jonrohan

"test": "../../script/npm-run-all build lint test-docs"
},
"dependencies": {
"primer-support": "4.4.1"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These buttons are designed to be used with btn so they can't be used without installing primer-buttons. It's not a code dependency, but perhaps should be a peer dependency? What do you think @jonrohan?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think peerDependency makes sense here. Be sure when you manually add it, that it's the current version of primer-buttons

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just had a flash back to trying to setup peer dependencies with Lerna from the original monorepo set up and it wasn't pretty. @gladwearefriends leave that to us, maybe it's all fine now since there's been lots of changes but I'd rather us deal with problems if they come up than you! We can do this before merging in tomorrow.

@@ -0,0 +1,32 @@
.btn-orange { @include btn-solid($white, lighten($orange-500, 7.5%), darken($orange-500, 7.5%)); }
.btn-blurple { @include btn-solid($white, mix($blue-400, $purple-400, 35%), mix($blue-600, $purple-600, 35%)); }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to give this a legit class name (such as indigo), and I'd like to discuss why we have this exception regarding colors. I think we should very rarely use a color in our UI for a single use case that is not used in any other way on our site. Do we really need this extra color? Could it be a shade variation of existing colors, or use another existing button color, such as btn-blue? Or, do we need to add indigo to our color system so that it may be used in more places than just this one button? cc @sophshep

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are good questions @broccolini. It looks like theyre only used on the business pages here: https://github.com/business and on app/views/coupons/business_plus_only/show.html.erb (not sure where that view is). I'm for keeping this as a one off style in github/github. im not sure if its used anywhere else on other one off marketing pages outside of github/github and it does seem weird to go out of the primer color system. What do you think @sophshep ?

At this point im gonna leave it out of this PR. I can put it back in if we think we should do it.


## Color

The `btn` has been extended with the marketing color palette:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest changing to more descriptive sentence:

Marketing buttons are available in orange, purple, and blurple indego.

😬

<a class="btn btn-outline-purple" href="#url" role="button">Link button</a>
<button class="btn btn-outline-green" type="button">Button button</button>
<div class="bg-gray-dark p-4 mt-4">
<button class="btn btn-transparent" type="button">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btn-transparent shouldn't be grouped with the outline options, it should have is own description and be a separate example.

```

## Additional sizing
There are cases where you might want to increase the size of a button, for example when putting a main CTA inside of a jumbotron or major page callout. The `btn-large` class does the following to make a button more prominent:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the intro paragraph can be more concise, and I don't think we need to call out the description in a numbered list or get into exact values, suggest changing to something like the following:

Use btn-large to increase the padding and border radius of a button. This is useful for prominent calls to action, and is often used in combination with jumbtron styles.

Type scale utilities can be used to alter the font-size if needed. Padding is applied in em's so that it scales proportionally with the font-size.

Side note: As someone less familiar with marketing styles, I had no idea what a jumbotron might be. I looked it up and this looks like it could be called hero which I think is more meaningful to people. We try to stick with class names that are obvious, transparent, and human-readable—could we change this to something more meaningful in future? Related, minitron and supertron could just me small and large 🤷‍♀️. I get this is probably just a bit of humor, but it's un-helpful for people learning to use Primer. cc @sophshep

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed the language in this section of the docs to "This is useful for prominent calls to action in hero sections."

Related, this section of the docs pertaining to btn-large is also moved into primer-buttons' readme.md as btn-largehas been moved back to primer-buttons as well, where it originally was just without documentation.


```html

<p class="f3">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Show how the default btn-large looks without a font size change, then show another example with a type scale utility.

border-color: $white;
}

.btn-transparent {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to be used anywhere in the github/github is it being used elsewhere for marketing sites?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is sometimes used on the ads we have on the homepage below the hero on github.com. I personally have also used it here on the hero and circular callouts https://partner.github.com/

@gladwearefriends
Copy link
Contributor Author

gladwearefriends commented Nov 7, 2017

To be included in the Changelog (as @broccolini requested above at #337 (comment))

New module primer-marketing-buttons. Buttons for marketing websites at GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants