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 Brand Guide to repo #26

Merged
merged 17 commits into from
Jul 28, 2023
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 56 additions & 2 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const fs = require('fs');
const pluginRss = require('@11ty/eleventy-plugin-rss');
const pluginNavigation = require('@11ty/eleventy-navigation');
const markdownIt = require('markdown-it');
const markdownItAttrs = require('markdown-it-attrs');
const markdownItAnchor = require('markdown-it-anchor');
const { headingLinks } = require("./config/headingLinks");
const yaml = require("js-yaml");
Expand All @@ -23,10 +24,14 @@ module.exports = function (config) {

// Specific scripts to guides
config.addPassthroughCopy("./assets/_common/js/*");
//

config.addPassthroughCopy({'./assets/_common/_img/favicons/favicon.ico': './favicon.ico' });
config.addPassthroughCopy({'./assets/_common/_img/favicons': './img/favicons' });

// Download folders
// TODO: Is this the right way to configure it?
config.addPassthroughCopy("./assets/**/dist/*");
beechnut marked this conversation as resolved.
Show resolved Hide resolved

// Add plugins
config.addPlugin(pluginRss);
config.addPlugin(pluginNavigation);
Expand All @@ -51,6 +56,55 @@ module.exports = function (config) {
// Allow yaml to be used in the _data dir
config.addDataExtension("yaml", contents => yaml.load(contents));

config.addFilter('contrastRatio', function(color1, color2) {
return contrastRatio(color1, color2);
});

// TODO: Where can we organize these functions so they're not in the main eleventy.js file?
beechnut marked this conversation as resolved.
Show resolved Hide resolved
function contrastRatio(hex1, hex2) {
lum1 = luminance(hex1)
lum2 = luminance(hex2)
if (lum1 >= lum2) {
lighter = lum1;
darker = lum2;
} else {
darker = lum1;
lighter = lum2;
}
return (lighter + 0.05) / (darker + 0.05)
}

function luminance(hex) {
const [r8, g8, b8] = hexToRgb(hex)
const [r, g, b] = [r8, g8, b8].map((component) => {
const value = component / 255;
return value <= 0.03928 ? value / 12.92 : Math.pow((value + 0.055) / 1.055, 2.4);
});
return r * 0.2126 + g * 0.7152 + b * 0.0722;
};

function hexToRgb(hex) {
hex = hex.slice(1);
const value = parseInt(hex, 16);
const r = (value >> 16) & 255;
const g = (value >> 8) & 255;
const b = value & 255;

return [r, g, b];
};

config.addFilter('humanReadableContrastRatio', function(ratio) {
// SMELL: I can't stand how this is coded.
if (ratio < 4) {
digits = 1
} else if (ratio < 5) {
digits = 2
} else {
digits = 0
}
`${ratio.toFixed(digits)}:1`
});

config.addFilter('readableDate', (dateObj) => {
return DateTime.fromJSDate(dateObj, { zone: 'utc' }).toFormat(
'dd LLL yyyy'
Expand Down Expand Up @@ -105,7 +159,7 @@ module.exports = function (config) {
}).use(markdownItAnchor, {
permalink: headingLinks,
slugify: config.getFilter('slug'),
});
}).use(markdownItAttrs);
config.setLibrary('md', markdownLibrary);

// Override Browsersync defaults (used only with --serve)
Expand Down
20 changes: 20 additions & 0 deletions _data/navigation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,26 @@ agile:
- name: More 18F guides
url: https://18f.gsa.gov/guides/

brand:
- name: Introduction
url: /brand/
- name: Logo
url: /brand/logo/
- name: Color palette
url: /brand/color-palette/
- name: Typography
url: /brand/typography/
- name: Icons
url: /brand/icons/
- name: Templates
url: /brand/templates/
- name: Images
url: /brand/images/
- name: Principles
url: /brand/principles/
- name: More 18F guides
url: https://18f.gsa.gov/guides/

content-guide:
- name: About this guide
url: /content-guide/
Expand Down
11 changes: 7 additions & 4 deletions _data/titles_roots.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@
default:
title: 18F Approaches
root: /
accessibility:
accessibility:
title: Accessibility
root: /accessibility/
agile:
agile:
title: Agile
root: /agile/
content-guide:
brand:
title: Brand
beechnut marked this conversation as resolved.
Show resolved Hide resolved
root: /brand/
content-guide:
title: Content Guide
root: /content-guide/
derisking:
derisking:
title: De-risking Guide
root: /derisking/
19 changes: 13 additions & 6 deletions _includes/guidelist.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,29 @@
<h2> Some approaches and stuff</h2>
<div class="grid-row grid-gap">

<div class="tablet:grid-col-3">
<a href="{{'/accessibility/' | url }}">
<div class="tablet:grid-col-3">
<a href="{{'/accessibility/' | url }}">
{% image_with_class "assets/_common/_img/accessibility.svg" "maxw-6" "" %}
<p>So accessibiliity</p>
</a>
</div>

<div class="tablet:grid-col-3">
<a href="{{'/agile/' | url }}">
<div class="tablet:grid-col-3">
<a href="{{'/agile/' | url }}">
{% image_with_class "assets/_common/_img/agile.svg" "maxw-6" "" %}
<p>So agile</p>
</a>
</div>

<div class="tablet:grid-col-3">
<a href="{{'/content-guide/' | url }}">
<div class="tablet:grid-col-3">
<a href="{{'/brand/' | url }}">
{% image_with_class "assets/_common/_img/agile.svg" "maxw-6" "" %}
<p>Such brand</p>
</a>
</div>

<div class="tablet:grid-col-3">
<a href="{{'/content-guide/' | url }}">
{% image_with_class "assets/_common/_img/content.svg" "maxw-6" "" %}
<p>Very content-guide </p>
</a>
Expand Down
9 changes: 4 additions & 5 deletions assets/_common/styles/_uswds-theme-settings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ $brand-color-dark: #1C304A;
$theme-font-path: '../../../node_modules/@uswds/uswds/dist/fonts',
$theme-image-path: '../../../node_modules/@uswds/uswds/dist/img',

// TODO: remove
// TODO: remove
$theme-hero-image: '../_img/hero.png',


Expand All @@ -39,7 +39,7 @@ $brand-color-dark: #1C304A;

/*------------------------------------------------
## Primary color
-------------------------------------------------*/
-------------------------------------------------*/
$theme-color-primary-darkest: 'blue-90',
$theme-color-primary-darker: $brand-color-dark,
$theme-color-primary-dark: 'blue-70v',
Expand All @@ -50,14 +50,13 @@ $brand-color-dark: #1C304A;

/*------------------------------------------------
## Accent color
-------------------------------------------------*/
-------------------------------------------------*/
$theme-color-accent-cool-dark: 'cyan-50v',
$theme-color-accent-cool: $brand-color-bright,
$theme-color-accent-cool-light: 'cyan-20v',

/*------------------------------------------------
## Error color
-------------------------------------------------*/
-------------------------------------------------*/
$theme-color-error-lighter: 'red-warm-5v',
);

1 change: 0 additions & 1 deletion assets/_common/styles/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ Custom styling

// TODO: Delete
// @forward "overrides/_hero.scss";

Binary file added assets/brand/dist/18F-Feather-Icons--all.pdf
Binary file not shown.
Binary file not shown.
Binary file added assets/brand/dist/18F_Color_Palette.zip
Binary file not shown.
Binary file added assets/brand/dist/18F_Desktop_Art.zip
Binary file not shown.
Binary file added assets/brand/dist/18F_Logo.zip
Binary file not shown.
Binary file added assets/brand/dist/18F_VideoBackgrounds.zip
Binary file not shown.
Binary file added assets/brand/dist/18F_feather.zip
Binary file not shown.
Binary file added assets/brand/dist/Using_18Fs_Templates.pdf
Binary file not shown.
Binary file added assets/brand/favicon.ico
Binary file not shown.
Binary file added assets/brand/img/18F-Logo-L.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/brand/img/18F-Logo-M.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/brand/img/18F-Logo-S.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions assets/brand/img/18F-Logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/brand/img/18F-color-palette.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/brand/img/18F-slide-theme-cover.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/brand/img/18FDesktop-Preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/brand/img/18F_VideoBG_6Illo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions assets/brand/img/18f-logo-blue.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/brand/img/Instructions_Preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions assets/brand/img/Slack_Mark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/brand/img/Template_Preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/brand/img/angle-arrow-down-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/brand/img/angle-arrow-up-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/brand/img/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/brand/img/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions assets/brand/img/gsa-logo-blue.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/brand/img/placeholder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading