Unverified Commit f3f4ca3e authored by Balint Lendvai's avatar Balint Lendvai Committed by GitHub

Update examples/with-carbon-components (#15190)

The example used an outdated version of carbon components v9.

The latest got a huge facelift, new components and a lot of optimizations.
I updated the example with carbon-components v10.
parent 14eb907c
......@@ -42,3 +42,11 @@ yarn dev
```
Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).
## Optimizations
In this example we import carbon components in the `styles/custom-theme.scss` file like this:
@import '~carbon-components/scss/globals/scss/styles.scss';
When we start to consider the performance of this approach, however, it becomes clear that this will include every single bit of CSS that Carbon outputs. Sometimes, you totally need everything that the project provides, but for a good number of teams you may find yourself using only a subset of our components. Here is a great article about how you can optimize your application using carbon components:
https://medium.com/carbondesign/minimal-css-with-carbon-b0c089ccfa71
......@@ -10,10 +10,12 @@
},
"license": "ISC",
"dependencies": {
"carbon-components": "^9.6.4",
"carbon-components-react": "^6.19.1",
"@carbon/icons-react": "^10.3.0",
"carbon-components": "^10.3.0",
"carbon-components-react": "^7.3.0",
"carbon-icons": "^7.0.7",
"next": "latest",
"node-sass": "^4.12.0",
"react": "^16.7.0",
"react-dom": "^16.7.0"
}
......
@import './export.scss';
@import '~carbon-components/scss/globals/scss/styles.scss';
$edited: true;
$brand-01: #00be00;
$brand-02: #4f8b4f;
$brand-03: #bc32f7;
$inverse-01: #ffffff;
$inverse-02: #272d33;
$ui-01: #ffffff;
$ui-02: #f6f6f6;
$ui-03: #ececec;
$ui-04: #c0bfc0;
$ui-05: #595859;
$text-01: #4d234b;
$text-02: #595859;
$text-03: #777677;
$field-01: #ffffff;
$field-02: #ffffff;
$support-01: #e62325;
$support-02: #34bc6e;
$support-03: #fed500;
$support-04: #777677;
$use-layer: false;
$input-border: 1px solid $ui-04;
$input-label-weight: 700;
$button-font-weight: 400;
$button-font-size: 1rem;
$button-border-radius: 1rem;
$button-height: 32px;
$button-padding: 0 2rem;
$button-padding-sm: 0 1rem;
$button-border-width: 1px;
$accordion-flex-direction: row-reverse;
$accordion-justify-content: space-between;
$accordion-arrow-margin: 0 0.25rem 0 0;
$accordion-title-margin: 0 0 0 0;
$accordion-content-padding: 0 1.75rem 0 0;
$card-text-align: center;
$card-flex-align: center;
$checkbox-border-width: 1px;
$snippet-background-color: $ui-03;
$content-switcher-border-radius: 1.5rem;
$content-switcher-option-border: none;
$data-table-heading-transform: none;
$data-table-heading-border-bottom: 1px solid $ui-04;
$data-table-row-height: 5rem;
$modal-border-top: none;
$modal-footer-background-color: transparent;
$progress-indicator-bar-width: none;
$progress-indicator-stroke-width: 2;
$progress-indicator-line-offset: 0.7rem;
$radio-border-width: 1px;
$structured-list-padding: 2rem;
$structured-list-text-transform: none;
$nav-01: #1b2834;
$nav-02: #1c496d;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment