GithubHelp home page GithubHelp logo

cloudfour / cloudfour.com-patterns Goto Github PK

View Code? Open in Web Editor NEW
24.0 24.0 3.0 70.24 MB

The design system, component library and documentation for cloudfour.com and related projects

Home Page: https://cloudfour-patterns.netlify.app

JavaScript 8.52% TypeScript 7.79% SCSS 28.53% Twig 20.73% MDX 34.44%
css design-system javascript pattern-library storybook twig

cloudfour.com-patterns's People

Contributors

aileenjeffries avatar ariannachau avatar calebeby avatar derekshirk avatar dromo77 avatar erikjung avatar gerardo-rodriguez avatar github-actions[bot] avatar grigs avatar josh68 avatar megnotarte avatar nicolemors avatar paul-hebert avatar renovate-bot avatar renovate[bot] avatar spaceninja avatar tylersticka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cloudfour.com-patterns's Issues

Navigation sections need more logical order

As discussed on #58

I wonder if it's time to order the sidebar views? Feels like Overview, Typography, Icons and Components might be better. It feels weird having Typography at the end because it's so foundational.

We just need to update src/views/layouts/includes/f-nav.html.

Border around "Our Work" photo inconsistent with other patterns

The "Our Work" photo has an outer border that creates a visual "gap" between the photo and the viewport edge in narrow windows:

screen shot 2016-07-10 at 12 42 03 pm

This also contradicts the style of the Thumbnail pattern, which uses an inset shadow so the border color is within the image (rather than outside):

screen shot 2016-07-10 at 12 43 32 pm

Modernizr

We should include a custom Modernizr build so we can do feature tests.

I've really enjoyed gulp-modernizr for personal projects, as it dynamically generates the custom build (making maintenance much easier).

hyphens: auto in Firefox

I noticed that hyphens is set to auto in our body definition. Firefox take this as all the excuse it needs to put hyphens everywhere. I think this makes things harder to read and @megnotarte agrees with me. Can we just take this out or is there a reason it is there?

screen shot 2016-06-30 at 12 48 37 pm

CSS theme and custom property organization is needed

We currently have theme.css and theme-map.css.

theme.css

This defines the theme in fundamental terms, but not how it is applied to
the components. That is done in theme-map.css.
https://github.com/suitcss/theme/blob/master/lib/theme.css

Our themes.css looks pretty good currently. It's very low-level and mentions no component or content specifics. Our theme-map.css is almost empty, which is what we should address next.

theme-map.css

The purpose of this file is to map the abstract custom properties from theme.css into more specifically named groups. And from those more specific groupings, we can have a basis for our even more specific component properties. For example:

/* theme.css */
:root {
  --color-black: #222;
}

:root {
  --spacing: 1rem;
  --spacing-sm: .5rem;
}
/* theme-map.css */
:root {
  --base-color: var(--color-black);
}

:root {
  --component-spacing: var(--spacing-sm);
}
/* some-component.css */
:root {
  --SomeComponent-color: var(--base-color);
  --SomeComponent-padding: var(--component-spacing);
}

Tasks

We currently have a small but growing number of components that define their own custom properties, but with many values being repeated in multiple files. We need to replace those values with var() references to properties within theme-map.css.

  • Come up with a sensible convention for grouping and naming properties in the theme map
  • Come up with a sensible convention for what can or cannot go into the theme map
    • For example, no new values may occur, properties must only reference values from theme.css
  • Replace static component properties with references to the theme map (where applicable)

Solidifying the JavaScript approach

Overview

The JavaScript for this pattern library currently consists of:

  • Proof-of-concept modules for low-level utility things (like object merging and DOM iteration)
  • Some modules for animation-related things (used only by the Sky/Nav component)
  • Some component modules that evolved from sandbox demos (Sky, FloatLabel)
  • Externals: a custom Modernizr build, svgxuse
src/assets/toolkit/scripts/
โ”œโ”€โ”€ lib
โ”‚ย ย  โ”œโ”€โ”€ component
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ float-label.js
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ sky.js
โ”‚ย ย  โ”œโ”€โ”€ dom
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ attributes.js
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ core.js
โ”‚ย ย  โ”œโ”€โ”€ fx
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ easing.js
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ tween.js
โ”‚ย ย  โ””โ”€โ”€ util
โ”‚ย ย      โ””โ”€โ”€ object.js
โ””โ”€โ”€ toolkit.js

What it currently lacks:

  • DOM library
  • Polyfills
  • Any system for routing (or initializing things on specific pages)

Questions

Polyfills or modules for things like classList and Object.assign?

IMO, polyfills are a better solution. I would look into what http://polyfill.io has to offer. We can either include the hosted script, or directly bundle in the specific polyfills used for each feature we depend on.

Is Modernizr still the best feature detection solution?

@tylersticka pointed out a potential alternative: http://featurejs.com.

It differs from Modernizr in a few ways:

  • It doesn't auto-run its tests when the page loads (they are executed cleverly upon first access)
  • It doesn't automatically add classes to the <html> element (we would need to do that if needed)
  • It is smaller in scope for what you can detect
  • It is smaller in file size

I think feature.js would be a fine fit. Even though we already have a system in place for Modernizr, we aren't really using many of the feature detections yet, so the transition should be mostly reductive.

Do we need a DOM library?

We've been getting by without one, but I'm not sure. Some things to consider:

  • We currently only have two components that need JS.
  • Will we need more complex DOM scripting as complete pages start coming together?
  • Will we need any async request handling?
  • Are we sacrificing consistency by rolling our own DOM manipulations? (example)
  • If using a library, it may need some webpack finessing

FWIW, I think Bliss looks like a nice fit, if we decide to use anything. I believe the consensus is that jQuery is too hefty, but I'm not 100% sure on that.

TODOs

  • Remove the stuff we aren't using (looking in the lib directory)
  • Decide on the inclusion of a DOM library
  • Decide on the feature detection library. If using feature.js:
    • Remove Modernizr script
    • Remove Modernizr Gulp integrations
    • Update existing instances of Modernizr usage in the JS (if any)

/CC @tylersticka @saralohr @nicolemors

Node packages are old

We should update the ones that we can.

Package                   Current  Wanted  Latest  Location
babel-loader                5.0.0   5.0.0   5.3.2  babel-loader
del                         1.2.0   1.2.1   2.0.1  del
fabricator-assemble         1.1.5   1.1.9   1.1.9  fabricator-assemble
gulp-imagemin               2.2.1   2.3.0   2.3.0  gulp-imagemin
babel-core                  5.1.5   5.1.5  5.8.23  babel-core
gulp-postcss                5.1.9  5.1.10   6.0.0  gulp-postcss
browser-sync                2.7.6   2.9.1   2.9.1  browser-sync
gulp-util                   3.0.5   3.0.6   3.0.6  gulp-util
gulp-svg-sprite             1.2.5   1.2.9   1.2.9  gulp-svg-sprite
postcss-bem-linter          0.4.0   0.4.0   1.0.1  postcss-bem-linter
postcss-discard-comments    1.2.0   1.2.1   1.2.1  postcss-discard-comments
moment                     2.10.3  2.10.6  2.10.6  moment
cssnext                     1.8.0   1.8.4   1.8.4  cssnext
postcss-easings             0.2.0   0.2.0   0.3.0  postcss-easings
postcss-reporter            0.1.0   0.1.0   1.1.0  postcss-reporter
postcss-discard-empty       1.1.1   1.1.2   1.1.2  postcss-discard-empty
run-sequence                1.1.0   1.1.2   1.1.2  run-sequence
handlebars                  3.0.3   3.0.3   4.0.2  handlebars
webpack                    1.9.10  1.12.1  1.12.1  webpack

Explore performant strategy for JS embeds

There seem to be two types of embeds included as part of blog content.

Some (YouTube, Vimeo, SlideShare, etc.) embed via an <iframe>. Because this is markup-only, it's pretty straightforward. The recent addition of FlexEmbed (see #44) will get us 90% of the way there with these.

But the others use a <script> tag, by itself or (more often) with fallback content.

Examples

CodePen

With "result" tab visible by default:

<p data-height="480" data-theme-id="0" data-slug-hash="EjdPKm" data-default-tab="result" data-user="tylersticka" class='codepen'>See the Pen <a href='http://codepen.io/tylersticka/pen/EjdPKm/'>Shifty Tiles: Part 3</a> by Tyler Sticka (<a href='http://codepen.io/tylersticka'>@tylersticka</a>) on <a href='http://codepen.io'>CodePen</a>.</p>
<script async src="//assets.codepen.io/assets/embed/ei.js"></script>

With "HTML" tab visible by default:

<div data-height="268" data-theme-id="0" data-slug-hash="QbZpab" data-default-tab="html" data-user="tylersticka" class='codepen'>
  <pre><code>&lt;div class=&quot;Tiles&quot;&gt;
    &lt;div class=&quot;Tile&quot;&gt;
      &lt;div class=&quot;Tile-content&quot;&gt;
        Tile 1
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class=&quot;Tile&quot;&gt;
      &lt;div class=&quot;Tile-content&quot;&gt;
        Tile 2
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class=&quot;Tile&quot;&gt;
      &lt;div class=&quot;Tile-content&quot;&gt;
        Tile 3
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class=&quot;Tile&quot;&gt;
      &lt;div class=&quot;Tile-content&quot;&gt;
        Tile 4
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class=&quot;Flyout is-open js-flyout&quot;&gt;
      &lt;div class=&quot;Flyout-content&quot;&gt;
        Flyout 1
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class=&quot;Flyout Flyout--2of4 js-flyout&quot;&gt;
      &lt;div class=&quot;Flyout-content&quot;&gt;
        Flyout 2
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class=&quot;Flyout Flyout--3of4 js-flyout&quot;&gt;
      &lt;div class=&quot;Flyout-content&quot;&gt;
        Flyout 3
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class=&quot;Flyout Flyout--4of4 js-flyout&quot;&gt;
      &lt;div class=&quot;Flyout-content&quot;&gt;
        Flyout 4
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class=&quot;Tile&quot;&gt;
      &lt;div class=&quot;Tile-content&quot;&gt;
        Tile 5
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class=&quot;Tile&quot;&gt;
      &lt;div class=&quot;Tile-content&quot;&gt;
        Tile 6
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class=&quot;Flyout js-flyout&quot;&gt;
      &lt;div class=&quot;Flyout-content&quot;&gt;
        Flyout 5
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class=&quot;Flyout Flyout--2of4 js-flyout&quot;&gt;
      &lt;div class=&quot;Flyout-content&quot;&gt;
        Flyout 6
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  <p>See the Pen <a href='http://codepen.io/tylersticka/pen/QbZpab/'>Shifty Tiles: Part 1</a> by Tyler Sticka (<a href='http://codepen.io/tylersticka'>@tylersticka</a>) on <a href='http://codepen.io'>CodePen</a>.</p>
</div>
<script async src="//assets.codepen.io/assets/embed/ei.js"></script>

Gist

<noscript>
  <a href="https://gist.github.com/9358004.git">View GitHub Gist</a>
</noscript>
<script src="https://gist.github.com/tylersticka/9358004.js"></script>

Speaker Deck

<script async class="speakerdeck-embed" data-id="4facdb4907fa81001f014061" data-ratio="1.3333333333333333" src="//speakerdeck.com/assets/embed.js"></script>

Twitter

<blockquote class="twitter-tweet" lang="en">
  <p><a href="https://twitter.com/adamconnor">@adamconnor</a> <a href="https://twitter.com/nickf">@nickf</a> Every &quot;expert&quot; I&#39;ve consulted has acknowledged that responsive design is ineffective for complex transactional web pages.</p>
  <p>&mdash; Walter Anasagasti (@freediverx) <a href="https://twitter.com/freediverx/statuses/354698695041744896">July 9, 2013</a></p>
</blockquote>
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>

Points of exploration

I'm creating this issue more as a starting point for discussion than anything. These are some of the questions this stuff has raised for me.

Performance

It his performant? A quick look at a page with multiple embeds (my recent CodePen-heavy post) shows that, because the file path is the same, the script is only requested once, which is good. I was also pleased to see almost every example I could find included the async attribute, which is awesome. But does every <script> result in re-executing of that logic? I assume it would, but I don't know! And I'm not sure how that would compare in terms of performance to one loop through all occurrences.

Cleanliness

I'm not sure if it's wrong or not, but it feels icky having <script> tags littered around the site. Also irritating is that they are typically wrapped with <p> by the WordPress editor (even in Markdown mode). The Gist <noscript> even included <br> tags (blech!).

There's also inconsistency. Speaker Deck doesn't include any fallback content for example, so before the script runs any preceding paragraphs might not make any sense. I love that tweets fallback to a blockquote, but it might not be consistent with the rest of the blockquotes on our site.

Is there some way to de-couple our fallback markup from the "progressive enhancement" of the actual embeds, to take control of the non-JS experience? Is there something out there that can help us with that? What the heck is oEmbed anyway? (Honest question.)

That kinda brings me to my next point...

Maintainability

I find it a little weird/scary that there is logical code inter-mingling with old embeds that may never be updated unless the third-party decides to update whatever URL I used at the time. It also seems totally stupid that it's 2015 and we're still pasting inline <script> tags directly into our markup.

We could adopt a rule that embeds must be included via a WordPress plugin... but oftentimes I've been more appalled by the markup (and additional JS dependencies) plugins provide than I have with what the sites generate themselves when you click "embed"!

Ideally, I'd love it if embeds would work like Slack or Basecamp, where just pasting a certain URL results in the embed just kind of happening... but that gets us further away from the markup control I mention earlier. Maybe these things are not compatible. I'm not sure.

Responsive heading sizes are needed

Currently, the larger headings aren't very functional at narrow screen sizes. We should make the range of sizes between "smallest" and "largest" gradually increase in proportion to the screen width.

Type sizes

Tota11y doesn't work on sandbox pages

Not a huge deal, but it's a convenient tool. The icon is fixed to the bottom of the page content, rather than the viewport, and it doesn't do anything when clicked.

Prep JS modules

In review of #28, @erikjung pointed out that it might be a good time to decide how we want to structure JS modules for this project. I wanted to document this need with an issue we could reference later.

Based on @lharding's talk (slides here), it sounds like the candidates would be Browserify or Webpack.

(I personally would like the ability to reference small, recurring utility modules for things we typically rely on jQuery for. I think it would show how forward-thinking cloudfour.com is if we do not rely on gargantuan libraries unless we find that they are absolutely needed. But that may not be realistic!)


@erikjung @lyzadanger @lharding @mrgerardorodriguez

Send editorconfig-consistent options to fabricator-assemble for beautify

When invoking the fabricator task via gulp as we do, we need to pass additional opts for beautify.

The obvious way to do this is to pass a literal opt object when invoking the fabricate task via gulp.

js-beautify claims that it will respect a .jsbeautifyrc file in the path. This may or may not work depending on what the path is considered to be at fabricate-time. I think it's worth a try.

Note that the current organization of our gulp file and tasks is inherited from fabricator and isn't our standard/ideal form. There was a ticket once about this on our fork, but I decided that it wasn't strictly necessary to fix at the time. Anyway, something to be aware of. My comment that "we know what we like" vis-a-vis gulp is probably not fair WRT @mrgerardorodriguez as he hasn't been exposed to it :).

Tabs are still among us

I'm seeing a few files that still have tabs. We should probably nuke them.

A few targets, for example:

  • src/views/sandbox.html
  • src/views/pages.html
  • src/views/index.html

Edge: Home animation screen contents aren't visible

This one's specific to Microsoft Edge... it works fine in IE11 and every other browser I tried. Everything else about the animation works flawlessly, it's only the inner content that isn't displaying. Even more mysterious: The clip-path is working, because the white screen color is being clipped to the correct size. ๐Ÿ˜•

capture

Custom color property names should correspond with "webcolors"

https://zaim.github.io/webcolors/

There was some discussion about this a few months ago. Imposing this constraint guideline on color names will prevent our variables from gradually mutating into a mess of unmaintainable variations. We should end up with a list of colors that fall within this grouping:

/** 
 * Example from https://github.com/zaim/webcolors/blob/master/mrmrs/index.css 
 */

:root {
  --color-aqua: #7FDBFF;
  --color-blue: #0074D9;
  --color-lime: #01FF70;
  --color-navy: #001F3F;
  --color-teal: #39CCCC;
  --color-olive: #3D9970;
  --color-green: #2ECC40;
  --color-red: #FF4136;
  --color-maroon: #85144B;
  --color-orange: #FF851B;
  --color-purple: #B10DC9;
  --color-yellow: #FFDC00;
  --color-fuchsia: #F012BE;
  --color-gray: #AAAAAA;
  --color-white: #FFFFFF;
  --color-black: #111111;
  --color-silver: #DDDDDD;
}

Core styles

We need some styles in place for "core" elements such as:

  • Body copy
  • Headings
  • Rules
  • Additional normalization or resets

Size modifiers should use verbose adjectives

I noticed while contributing to #30 that the size modifiers for .Separator and .TextBlock differed from those in .Icon. The former are full words (large and small) while the latter uses abbreviations (lg and sm).

This also made me remember a peeve of mine when working with classes for some of our clients who use that type of abbreviation for both breakpoints and element size: It's really difficult to tell which one a class is referring to! Often position is the only thing to go on.

So I think it would be better if we standardized.

The abbreviations xs, sm, md, lg and xl can continue to be used for variables and for class names that apply at specific breakpoint sizes. Because breakpoint classes are often more repetitive than others (a grid cell could contain several), they benefit from the conciseness.

But if the goal of the modifier is to make something smaller or larger, then we should use the full word.

This also makes more sense when you look at how the class names typically relate to the initial state of an element:

Old Suffix New Suffix
None smallest
xs smaller
sm small
Default Default
md large
lg larger
xl largest

Tasks

  • Review typographic modifiers for consistency
  • Revise .Icon modifiers
  • Revise documentation

Consider not wrapping code samples

We have a lot of verbose code samples in the blog, and I think the wrapping is ugly. Example:

screen shot 2016-06-30 at 3 23 00 pm

We should consider making this a good ol' pre rather than pre-wrap, and maybe doing something with overflow-x on the container.

Headings and Notes hidden

I think when we removed the toggle functionality from fabricator:
screen shot 2015-06-03 at 3 04 53 pm
our Headings and Notes got turned off as well.

In the source code the class f-u-hidden is being added to those elements.

screen shot 2015-06-03 at 3 11 44 pm

After removing class:
screen shot 2015-06-03 at 3 12 40 pm

Monospace font is needed

  • Add --font-family-mono: "Source Code Pro", monospace
  • Apply it to all monospace-loving elements

JavaScript Testing???

Reading through a comment here got me wondering...are we going to implement some sort of JS testing? We probably should, but wasn't clear and figured I should capture the thought as it came to mind.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.