Coder Social home page Coder Social logo

carbon-design-system / gatsby-theme-carbon Goto Github PK

View Code? Open in Web Editor NEW
353.0 18.0 272.0 86.58 MB

A Carbon inspired Gatsby theme

Home Page: https://gatsby.carbondesignsystem.com/

License: Apache License 2.0

JavaScript 36.94% Shell 0.40% SCSS 21.53% MDX 41.13%
gatsby-theme-carbon carbon hacktoberfest gatsby

gatsby-theme-carbon's Introduction

Gatsby Theme Carbon

❗ This project is maintained by community contributions. The original contributor, Carbon Design System, is no longer involved in maintaining this project.

The Gatsby Carbon theme includes all the configuration you need to build a beautiful site inspired by the Carbon Design System.

Validate release-it

npm (scoped) npm npm

GitHub Release Date - Published_At GitHub Repo stars GitHub watchers GitHub issues

The Gatsby Carbon theme includes all the configuration you need to build a beautiful site inspired by the Carbon Design System.

Resources

gatsby-theme-carbon's People

Contributors

abbeyhrt avatar aledavila avatar alisonjoseph avatar andreancardona avatar barlock avatar boneskull avatar carbon-automation[bot] avatar connor-leech avatar davidicus avatar dependabot[bot] avatar elycheea avatar emyarod avatar eng618 avatar grahamharper avatar imgbotapp avatar jeffchew avatar jendowns avatar jnm2377 avatar jonwrona avatar joshblack avatar kodiakhq[bot] avatar luizamendes avatar mariuszmickiewicz avatar mzuliani-ibm avatar rodet avatar sstrubberg avatar tay1orjones avatar vpicone avatar xxxle0 avatar xylish7 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gatsby-theme-carbon's Issues

LeftNav will not scroll on resize or mobile

When the page is resized vertically to be smaller than the list in the nav, the LeftNav does not scroll, preventing the user from seeing the full list. This is also true on mobile emulation; although some range of vertical motion is available the list is still truncated.

Add docs for configuration and shadowing

Config: search and manifest options. Additional, recommended, plugins for extension.

Shadowing -> components meant to be shadowed and best practices for doing so.

LeftNavItem seems to ignore Gatsby `pathPrefix` variable

Similar in spirit to #11 -- involves usage of Gatsby's pathPrefix variable (https://www.gatsbyjs.org/docs/path-prefix/).

I believe that LeftNavItem is not using Gatsby's pathPrefix correctly, which means that prefixes set by the consumer are not being resolved & paths in the left nav bar are not correct.

As is the case with the HeaderName component, it appears as though LeftNavItem is passing through Gatsby's Link, which should resolve a pathPrefix correctly and generate the correct path. However, pathPrefix is being ignored in my case.

Let me know if you need to see an example of this in our repo. Our project is correctly in GHE. πŸ‘

Footer and PageHeader alignment issues

There are some alignment bugs occurring around some core components. Notably the PageHeader and Footer components.

PageHeader

The title text is different than the IDL implementation

54e69a00-7826-11e9-82b2-fc20a1c71f00

Footer

Looks to be some padding issues in relation to the content

Screen Shot 2019-05-17 at 11 35 57 AM

A few styling inconsistencies

Sorry I know this is still a WIP so feel free to ignore/close this if it's a known issue.

I noticed a few styling inconsistencies from the Carbon site:

  • left nav should not have a drop shadow because it's pinned open.
  • right side app switcher drop shadow visible. App switcher should have a drop shadow, but only when open. This drop shadow should not be visible when app switcher is closed.
    image
  • footer is nudged right. Footer type should left align with main content.
    image

Navigation bugs/enhancements

  • Need the ability to have a disabled item in navigation (see live IDL site)
  • Top level page loses active state when there are 2 or more tabs selected
  • Nav accordion needs to be able to be open by default
  • Nav should be closed on mobile by default

Website 10.3 Iteration plan

10.3 Iteration Plan

This plan captures our work on the Website project for May. This work will consist of the content for the Patterns presentations for June, content updates to the Carbon website and the build-out of the IBM Design Language website and underlying Gatsby theme work in order to make that happen.

Also included is providing assistance to /design/ai developers for their release and managing the build of the brand guidance site contractors to ensure adherence to our models and architecture.

Patterns

@jeanservaas add issues here

  • Curate already existing content
  • Course outline with supporting materials to allow anyone to present the information

1st or 2nd week of June, 2-day training

Content

This is work to continue to iterate and improve upon the content on the Carbon website.

Carbon website

Re-architecture of the IBM Design Language website, and rebuild.

Development of Carbon's Gatsby website theme.

  • ResourceCard
  • ArticleCard #21
  • ImageCard
  • Homepage #31
  • Prev/next #32
  • WebsiteTabs #14
  • blockquote #18
  • aside #19
  • navigation bugs #33

enhancement[app switcher]: animation update

##enhancement[app switcher]: animation update

Why:
After the truncation of the app switcher in issue #57 it no longer makes sense for the panel to push in from the side. Now that it floats, the panel animation should emulate the behavior of an overflow menu.

  • 1px, Gray 80 stroke animates up 90 degrees to include the "close" icon in the component when the floating app switcher opens

  • In desktop, panel should animate on like an overflow menu; in mobile, the animation remains a side push and still takes over the screen vertically

enhancement [app switcher]: truncate app switcher

enhancement [app switcher]: truncate app switcher

Why:
The app switcher now is mirroring the left nav behavior almost exactly which is confusing to the user; by keeping the left nav anchored and floating the global app switcher we create a clearer hierarchy between the two.


Where:
This floating app switcher remains a global element across all practices... we just want to make that function clearer. It does not change color when the local content changes, it operates on a separate logic / independent of the local left nav.

  • All type and core / interative color tokens, dropshadow and most geometries remain the same

  • Add subheads

  • shorten app switcher in Max, XL, Lrg and tablet breakpoints (truncate app switcher 24px after the last link item block

  • 1px, Gray 80 stroke animates up 90 degrees to include the "close" icon in the component when the floating app switcher opens

  • In desktop, panel should animate on like an overflow menu; in mobile, the animation remains a side push and still takes over the screen vertically

image

Design specs:

carbon-design-system/carbon-website#1200

Code snippet component (code/pre)

This is already using the Carbon code snippet component, however, it has a bunch of style overrides to make it look like its using the dark theme.

  • Update component to pull dark theme directly

Video component

  • Need to move all styles related to the video component from the page.scss to a video.scss file.
  • Custom play button
  • Custom preview image

enhancement[body copy width]: gatsby template

enhancement[body copy width]: gatsby template

Issue: Body copy width too short on the Carbon site. The DL site lengthened it a while ago, and the DL body copy width is the one Mike would like the Gatsby template to match.

  • Make intro / body copy paragraph width 8 cols wide (looks like it's at 7 cols wide right now on the Carbon site, that's also what's reflected in our sketch files)

image.png


This includes all copy (intro paragraphs too)

image.png

ResourceCard bugs

  • Need 25% padding to the right of card
  • svg images aren't displaying (site wide not just Cards)
  • subtitle font is too large. should be .875rem, heading-01 but font weight 400

Aside component

The Aside component will be a wrapper component used inside a <Col> component for sidebar callout text. You should be able to place any markdown inside of it.

<Aside>

#### Good design is always good design.

What we borrow from our own design history is not a mid-century aesthetic in stylistic terms, but the modernist attitudes and approach used at the time.

Eliot Noyes taught us brand is character, and should be built thro.....

</Aside>

Design spec
https://www.ibm.com/design/language/philosophy

Failed prop types and <code> style issues

@alisonjoseph

/component-examples/markdown

  • code prop type error
Warning: Failed prop type: Invalid prop `children` of type `object` supplied to `Code`, expected `array`.
    in Code (created by MDXCreateElement)
    in MDXCreateElement (created by MDXContent)
    in div (created by Grid)
    in Grid (created by Context.Consumer)
    in Main (created by Default)
  • code prop type error
Warning: Failed prop type: Invalid prop `children` of type `object` supplied to `CodeSnippet`, expected `string`.
    in CodeSnippet (created by Code)
    in Code (created by MDXCreateElement)
    in MDXCreateElement (created by MDXContent)
    in div (created by Grid)
    in Grid (created by Context.Consumer)
    in Main (created by Default)
    in a (created by MDXProvider)
  • do-dont error

/component-examples/DoDontExample

think it's just missing the title

Warning: Failed prop type: The prop `title` is marked as required in `Vimeo`, but its value is `undefined`.
    in Vimeo (created by MDXCreateElement)
    in MDXCreateElement (created by MDXContent)
    in div (created by DoDontExample)
    in div (created by DoDontExample)
    in div (created by DoDontExample)
    in div (created by DoDontExample)
    in DoDontExample (created by MDXCreateElement)
    in MDXCreateElement (created by MDXContent)
    in div (created by Column)

In the footer

Inline code styles are being applied globally. Not sure if this is intended:

  • code snippet style
    Screen Shot 2019-05-10 at 1 44 31 PM

Header should use Gatsby `pathPrefix` so consumer paths don't break

Right now the Header component has a hard coded path: https://github.com/carbon-design-system/gatsby-theme-carbon/blob/master/packages/gatsby-theme-carbon/src/components/Header.js#L29

<HeaderName prefix="" to="/" element={Link}>

The / path won't work for many consumers, particularly those whose sites are built on a subdomain or subdirectory. For example, I'm unable to use Github Pages (gh-pages) to build my site to a https://pages.github.com/{ORG}/{REPO} path... the / simply leads to https://pages.github.com/.

Gatsby has a way to fix this with a pathPrefix variable in the site config: https://www.gatsbyjs.org/docs/path-prefix/. However, when I set a pathPrefix in my site config, that variable is ignored. Even though Gatsby's Link component is being passed through here (which should resolve the pathPrefix), the paths remain unaltered.

Let me know if you need to see an example of this in our repo. Our project is correctly in GHE. πŸ‘

Feature request: Large page header (lead space) size variant

We need to look into how devs could signal from MDX to use the larger page header for a specific page. One approach is to provide an alternate layout for them to export. This is how the Homepage is handled atm. This would be appropriate if the layout was dramatically different.

Another is option is to export a variable/options object that would be passed down on the page context: https://gatsby-mdx.netlify.com/misc

The lead space should have two options. the shortie that Carbon uses on component pages for example and the one the DL site uses which is the next size up. I think it’s 320. Both sizes will be needed I think.

Tabs on component pages have incorrect paths

The Problem

If you have a pathPrefix (i.e., https://www.gatsbyjs.org/docs/path-prefix/), then generated paths for component page tabs are incorrect. See here: https://jendowns.github.io/gatsby-theme-carbon/components/accordion/code (make sure there's no trailing slash, otherwise currentTab is empty 😬 )

So all of your tab paths on component pages will 404.

Testing Instructions

To demonstrate this, I made a sample repo ( https://github.com/jendowns/gatsby-theme-carbon) by forking gatsby-theme-carbon and then did this:

The key is that you need to deploy to an environment, like Github Pages, that has subdirectories in the path.

Adding `gatsby-plugin-sass` causes local `gatsby develop` to fail

Context

Using v0.5.2...

When I added gatsby-plugin-sass, I was unable to run gatsby develop locally:

success open and validate gatsby-configs β€” 0.025 s
success load plugins β€” 0.404 s
success onPreInit β€” 0.002 s
success initialize cache β€” 0.006 s
success copy gatsby files β€” 0.105 s
success onPreBootstrap β€” 0.010 s
success source and transform nodes β€” 3.597 s
success building schema β€” 0.183 s
success createPages β€” 0.000 s
success createPagesStatefully β€” 1.159 s
success onPreExtractQueries β€” 0.000 s
success update schema β€” 0.028 s
success extract queries from components β€” 0.093 s
success run static queries β€” 0.019 s β€” 4/4 217.88 queries/second
success run page queries β€” 0.047 s β€” 69/69 1480.86 queries/second
success write out page data β€” 0.004 s
success write out redirect data β€” 0.001 s
success Build manifest and related icons β€” 0.001 s
success onPostBootstrap β€” 0.002 s

info bootstrap finished - 7.548 s

error (node:26977) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
error (node:26977) DeprecationWarning: Resolver#doResolve: The type arguments (string) is now a hook argument (Hook). Pass a reference to the hook instead.
error There was an error compiling the html.js component for the development server.

See our docs page on debugging HTML builds for help https://gatsby.dev/debug-html


  WebpackError: ./node_modules/gatsby-theme-carbon/src/components/LeftNav/LeftNavItem.module.scss
  
  

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] develop: `gatsby develop`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] develop script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/jendowns/.npm/_logs/2019-05-16T20_36_19_858Z-debug.log
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Steps to reproduce

  1. yarn add gatsby-plugin-sass
  2. add the plugin to your gatsby-config.js
  3. yarn develop / gatsby develop

Caption component & image adjustments

Captions on the Carbon site are built into the image component. With the removal of the need for the offset class, we don't need the image component as a default. We can just place inside our <Col> component to have it display at the correct width.

However, this means we need a separate Caption component

<Caption>This is the caption</Caption>
or
<Caption className="my-custom-class">This is the caption</Caption>

html output should be

<div class="bx--col-lg-4 bx--col-md-4">
    <p class="bx--caption my-custom-class">Glyph usage in Buttons</p>
</div>

sass

@include carbon--type-style('body-short-01');
padding-top: $spacing-03;
margin-bottom: $spacing-06;
margin-top: -$spacing-06; // to account for default spacing below images
  • Update default image styles to have margin-bottom: $spacing-06

Consume Carbon Motion package in website

Currently, we are using the old motion variables $transition--base and $carbon--standard-easing for motion across the site.

We should work on consuming the motion package from carbon-elements and standardizing motion across the website.

As is:
Screen Shot 2019-04-29 at 11 53 03 AM

To be:
Screen Shot 2019-04-29 at 11 54 26 AM

Component list

Markdown components

  • Anchor links
  • DoDontExample
  • PageTable
  • Row
  • Col
  • Tile
  • Caption (new)
  • blockquote
  • Aside
  • WebsiteTabs (name?)
  • Video (clean up scss)
  • code/pre (works, needs cleanup, use dark theme)
  • ImageComponent (zoom/overlay)

Core site components

  • Next/Prev
  • EditLink
  • WebsiteAlert
  • PageHeader
  • Switcher
  • Footer
  • AlertBanner
  • GlobalSearch
  • Header
  • BackToTop

DL Theme components

  • Icon library
  • ColorBlock
  • TypeSpec
  • TypeScaleTable
  • TypeWeight

enhancement [app switcher]: add subheads / update content

enhancement [app switcher]: add subheads / update content

This is basically a content update; most tokens and interactive states remain the same, there's just an addition of a subhead token; some disabled links and tweaks in vertical spacing to accommodate the subheads.

Cupcake issue for #57

  • add subheads

  • tweak vertical spacing according to spec

image

Content urls:

Design: https://www.ibm.com/design/
IDL: https://www.ibm.com/design/language/
Brand Center: (unknown)

Product: https://www.carbondesignsystem.com/
Digital: https://www.ibm.com/standards/web/
Events: (unknown)

IBM Enterprise Design Thinking: https://www.ibm.com/design/thinking/
IBM design Research: https://www.ibm.com/design/research/
IBM AI: (unknown)
IBM iX: https://www.ibm.com/services/ibmix/

Global search should be disabled by default

The global search is really only helpful for documentation sites, it should be disabled by default but accessible as an option for sites wanting to enable search functionality.

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.