Skip to content

Commit

Permalink
Huge commit :) Finish refactoring default css custom props. Adds a bu…
Browse files Browse the repository at this point in the history
…ild process in the CSS package for generating a minified css-dist/common.min.css file which has the css custom properties required for things like font family, color, spacing, etc., that components require as a prerequisite. Used for all framework packages.
  • Loading branch information
roblevintennis committed Oct 4, 2020
1 parent b1457d2 commit 5fe65bd
Show file tree
Hide file tree
Showing 46 changed files with 887 additions and 343 deletions.
11 changes: 1 addition & 10 deletions agnosticui-css/button.css
Expand Up @@ -31,24 +31,15 @@

.btn-skin,
.btn {
/* The next few properties are actually quite important and influenced by an interview I heard
with Adam Wathan re building TailwindUI: https://fullstackradio.com/135 and it made me realize
some inconsistencies we had in button heights across the variants available. Now fixed! The
default button height is 38px (I like bigger fonts then them, but otherwise it's quite similar).
*/
--agnosticui-default-btn-side-padding: calc(1.5 * 16px);
--agnosticui-default-btn-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Open Sans", "Ubuntu", "Fira Sans", Helvetica, "Droid Sans", "Helvetica Neue", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
--agnosticui-default-btn-radius: 4px;

color: var(--agnosticui-btn-font-color, #333333);
background-color: var(--agnosticui-btn-bgcolor, #e9e9e9);
border-color: var(--agnosticui-btn-bgcolor, #e9e9e9);
/* seems like a reasonable default as chrome picks `outset` which results in a weird 3d effect */
border-style: solid;
/* this can be overriden, but it might mess with the balance of the button heights across variants */
border-width: var(--agnosticui-btn-border-size, 1px);

font-family: var(--agnosticui-btn-font-family, var(--agnosticui-default-btn-font-family));
font-family: var(--agnosticui-btn-font-family, var(--agnosticui-font-family));
font-weight: var(--agnosticui-btn-font-weight, 300);
font-size: var(--agnosticui-btn-font-size, 16px);
/* this can be overriden, but it might mess with the balance of the button heights across variants */
Expand Down
2 changes: 1 addition & 1 deletion agnosticui-css/button.html
Expand Up @@ -5,7 +5,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Button</title>
<link rel="stylesheet" href="./common.css">
<link rel="stylesheet" href="./demo-globals.css">
<style>
/* these styles are purely demonstration related styles only */
body {
Expand Down
2 changes: 1 addition & 1 deletion agnosticui-css/card.html
Expand Up @@ -4,7 +4,7 @@

<head>
<title>Card</title>
<link rel="stylesheet" href="./common.css">
<link rel="stylesheet" href="./demo-globals.css">
<style>
/* Body Layout (just demo stuff really) */
* {
Expand Down
148 changes: 70 additions & 78 deletions agnosticui-css/common.css
@@ -1,85 +1,77 @@
@import "button.css";
@import "button-group.css";
@import "card.css";
@import "colors.css";
@import "flexboxgrid-grid.css";
@import "flexboxgrid-col.css";
@import "flexboxgrid-row.css";
@import "header.css";
@import "headernav.css";
@import "headernavitem.css";
@import "input.css";
@import "progress.css";
@import "spacing.css";
@import "typography.css";
/**
* Color tokens
*/

body {
font-family: var(--agnosticui-font-family);
line-height: var(--agnosticui-line-height);
font-size: var(--agnosticui-body);
:root {
/* Please, please, please, at mimimum redefine primary and secondary ;) */
--agnosticui-primary: Fuchsia;
--agnosticui-secondary: Teal;
--agnosticui-gray-extra-light: #f8f8f8;
--agnosticui-gray-light: #e9e9e9;
--agnosticui-gray-mid: #d8d8d8;
--agnosticui-gray-mid-dark: #cccccc;
--agnosticui-gray-dark: #aaaaaa;
--agnosticui-dark: #333333;
--agnosticui-light: #ffffff;
/* Caption, Sub-heading, etc., can be added here */
}

h1, h2, h3, h4, h5, h6 { font-weight: 300; margin-bottom: 40px; }
h1 { font-size: var(--agnosticui-h1); }
h2 { font-size: var(--agnosticui-h2); }
h3 { font-size: var(--agnosticui-h3); }
h4 { font-size: var(--agnosticui-h4); }
h5 { font-size: var(--agnosticui-h5); }
h6 { font-size: var(--agnosticui-h6); }

/* For inline code blocks I use <i> */
i {
background-color: var(--agnosticui-gray-extra-light);
border: 1px solid var(--agnosticui-gray-mid);
border-radius: 3px;
display: inline;
font-family: var(--agnosticui-font-family-mono);
font-style: normal;
color: var(--agnosticui-dark);
margin: 0 3px 0 1px;
padding: 1px 5px 2px 5px;
position: relative;
top: -1px;
}

.quoted::before {
/* Many sans fonts do not have smart or book quotes so prefer ones that do */
font-family: Georgia, 'Times New Roman', Times, serif;
content: open-quote;
}

.quoted::after {
/* Many sans fonts do not have smart or book quotes so prefer ones that do */
font-family: Georgia, 'Times New Roman', Times, serif;
content: close-quote;
}

.quoted {
/* Kind of cludgy, but this will preserve your main font within the smart quotes */
font-family: inherit;
quotes: "“""”""‘""’";
/**
* Space tokens
*
* These spacing tokens are, essentially, literals for use on a
* slightly modified 8pt grid, but also converge conveniently with
* some common type scale boundaries:
* 10, 12, 14, 18, 24, 36, 48, 64, 72
* Note, that we do not prefix these with `agnostic-default-` as
* they're not meant to be overriden and mainly used:
* 1. internally within AgnosticUI
* 2. optionally by your app if you like these and want to
* import them for example.
* Feel free to use your spacing scale if you so desire.
*/
:root {
--Space-80: 80px;
--Space-72: 72px;
--Space-64: 64px;
--Space-56: 56px;
--Space-48: 48px;
--Space-40: 40px;
--Space-32: 32px;
--Space-24: 24px;
--Space-16: 16px;
--Space-14: 14px;
--Space-12: 12px;
--Space-10: 10px;
--Space-8: 8px;
--Space-6: 6px;
--Space-4: 4px;
}

/**
* Font size tokens
* These are perhaps a bit arbitrary but were chosen from both the
* default point sizes for type in OS X, and the classic typographic
* scale as provided by The Elements of Typographic Style which are:
* 9, 10, 11, 12, 13, 14, 18, 24, 36, 48, (alt. 60) 64, 72, 96, 144, 288
*
* You're encouraged to change these setttings to whatever suits your app's needs
* best—these are just sensible defaults to get you started.
*/

p {
font-size: 18px;
}

div,
section {
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
margin-bottom: var(--Space-40);
}

form {
width: 100%;
max-width: 100%;
}

.row {
flex-direction: row;
align-items: center;
:root {
--agnosticui-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Open Sans", "Ubuntu", "Fira Sans", Helvetica, "Droid Sans", "Helvetica Neue", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
--agnosticui-font-family-serif: Georgia, Cambria, "Times New Roman", Times, serif;
--agnosticui-font-family-mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
--agnosticui-line-height: 1.5;
--agnosticui-h1: 64px;
--agnosticui-h2: 48px;
--agnosticui-h3: 36px;
--agnosticui-h4: 24px;
--agnosticui-h5: 18px;
--agnosticui-h6: 14px;
--agnosticui-body: 16px;
--agnosticui-font-weight-bold: 600;
--agnosticui-font-weight-light: 300;
--agnosticui-font-color: #333333;
}
77 changes: 77 additions & 0 deletions agnosticui-css/css-dist/common.concat.css
@@ -0,0 +1,77 @@
/**
* Color tokens
*/

:root {
/* Please, please, please, at mimimum redefine primary and secondary ;) */
--agnosticui-primary: Fuchsia;
--agnosticui-secondary: Teal;
--agnosticui-gray-extra-light: #f8f8f8;
--agnosticui-gray-light: #e9e9e9;
--agnosticui-gray-mid: #d8d8d8;
--agnosticui-gray-mid-dark: #cccccc;
--agnosticui-gray-dark: #aaaaaa;
--agnosticui-dark: #333333;
--agnosticui-light: #ffffff;
/* Caption, Sub-heading, etc., can be added here */
}

/**
* Space tokens
*
* These spacing tokens are, essentially, literals for use on a
* slightly modified 8pt grid, but also converge conveniently with
* some common type scale boundaries:
* 10, 12, 14, 18, 24, 36, 48, 64, 72
* Note, that we do not prefix these with `agnostic-default-` as
* they're not meant to be overriden and mainly used:
* 1. internally within AgnosticUI
* 2. optionally by your app if you like these and want to
* import them for example.
* Feel free to use your spacing scale if you so desire.
*/
:root {
--Space-80: 80px;
--Space-72: 72px;
--Space-64: 64px;
--Space-56: 56px;
--Space-48: 48px;
--Space-40: 40px;
--Space-32: 32px;
--Space-24: 24px;
--Space-16: 16px;
--Space-14: 14px;
--Space-12: 12px;
--Space-10: 10px;
--Space-8: 8px;
--Space-6: 6px;
--Space-4: 4px;
}

/**
* Font size tokens
* These are perhaps a bit arbitrary but were chosen from both the
* default point sizes for type in OS X, and the classic typographic
* scale as provided by The Elements of Typographic Style which are:
* 9, 10, 11, 12, 13, 14, 18, 24, 36, 48, (alt. 60) 64, 72, 96, 144, 288
*
* You're encouraged to change these setttings to whatever suits your app's needs
* best—these are just sensible defaults to get you started.
*/

:root {
--agnosticui-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Open Sans", "Ubuntu", "Fira Sans", Helvetica, "Droid Sans", "Helvetica Neue", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
--agnosticui-font-family-serif: Georgia, Cambria, "Times New Roman", Times, serif;
--agnosticui-font-family-mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
--agnosticui-line-height: 1.5;
--agnosticui-h1: 64px;
--agnosticui-h2: 48px;
--agnosticui-h3: 36px;
--agnosticui-h4: 24px;
--agnosticui-h5: 18px;
--agnosticui-h6: 14px;
--agnosticui-body: 16px;
--agnosticui-font-weight-bold: 600;
--agnosticui-font-weight-light: 300;
--agnosticui-font-color: #333333;
}
1 change: 1 addition & 0 deletions agnosticui-css/css-dist/common.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

79 changes: 79 additions & 0 deletions agnosticui-css/css-dist/common.prefixed.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions agnosticui-css/css-dist/common.prefixed.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5fe65bd

Please sign in to comment.