diff --git a/packages/carbon-react/src/components/Skeleton/Skeleton.stories.js b/packages/carbon-react/src/components/Skeleton/Skeleton.stories.js
new file mode 100644
index 000000000000..be7685aa9bec
--- /dev/null
+++ b/packages/carbon-react/src/components/Skeleton/Skeleton.stories.js
@@ -0,0 +1,70 @@
+import React from 'react';
+import { SkeletonPlaceholder, SkeletonText } from 'carbon-components-react';
+import { withKnobs, select, boolean, number } from '@storybook/addon-knobs';
+
+const classNames = {
+ 'my--skeleton__placeholder--small': 'my--skeleton__placeholder--small',
+ 'my--skeleton__placeholder--medium': 'my--skeleton__placeholder--medium',
+ 'my--skeleton__placeholder--large': 'my--skeleton__placeholder--large',
+};
+
+const placeholderProps = () => ({
+ className: select('Classes with different sizes', classNames),
+});
+
+const widths = {
+ '100%': '100%',
+ '250px': '250px',
+};
+
+const textProps = () => ({
+ heading: boolean('Skeleton text at a larger size (heading)'),
+ paragraph: boolean('Use multiple lines of text (paragraph)'),
+ lineCount: number('The number of lines in a paragraph (lineCount)', 3),
+ width: select(
+ 'Width (in px or %) of single line of text or max-width of paragraph lines (width)',
+ widths,
+ '100%'
+ ),
+});
+
+export default {
+ title: 'Components/Skeleton',
+ decorators: [withKnobs],
+};
+
+export const _SkeletonPlaceholder = () => {
+ return (
+
+
+
+
+ );
+};
+
+export const _SkeletonText = () => {
+ return (
+
+
+
+ );
+};
diff --git a/packages/carbon-react/src/components/Skeleton/index.js b/packages/carbon-react/src/components/Skeleton/index.js
new file mode 100644
index 000000000000..68afb0c1c120
--- /dev/null
+++ b/packages/carbon-react/src/components/Skeleton/index.js
@@ -0,0 +1,8 @@
+/**
+ * Copyright IBM Corp. 2016, 2018
+ *
+ * This source code is licensed under the Apache-2.0 license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+export { SkeletonPlaceholder, SkeletonText } from 'carbon-components-react';
diff --git a/packages/react/src/components/CodeSnippet/__tests__/CodeSnippet-test.e2e.js b/packages/react/src/components/CodeSnippet/__tests__/CodeSnippet-test.e2e.js
index bfbea2773380..b846e5e3dbee 100644
--- a/packages/react/src/components/CodeSnippet/__tests__/CodeSnippet-test.e2e.js
+++ b/packages/react/src/components/CodeSnippet/__tests__/CodeSnippet-test.e2e.js
@@ -73,6 +73,7 @@ describe('CodeSnippet', () => {
it('should render', () => {
cy.findAllByText(/node/).should('be.visible');
+ cy.findAllByText(/Show more/).should('be.visible');
// snapshots should always be taken _after_ an assertion that
// a element/component should be visible. This is to ensure
@@ -95,3 +96,13 @@ describe('CodeSnippet', () => {
cy.percySnapshot();
});
});
+
+// https://github.com/cypress-io/cypress/issues/8418
+const resizeObserverLoopErrRe = /^ResizeObserver loop limit exceeded/;
+cy.on('uncaught:exception', (err) => {
+ if (resizeObserverLoopErrRe.test(err.message)) {
+ // returning false here prevents Cypress from
+ // failing the test
+ return false;
+ }
+});
diff --git a/packages/styles/scss/components/__tests__/skeleton-test.js b/packages/styles/scss/components/__tests__/skeleton-test.js
new file mode 100644
index 000000000000..7dd3f1a29396
--- /dev/null
+++ b/packages/styles/scss/components/__tests__/skeleton-test.js
@@ -0,0 +1,26 @@
+/**
+ * Copyright IBM Corp. 2018, 2018
+ *
+ * This source code is licensed under the Apache-2.0 license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ * @jest-environment node
+ */
+
+'use strict';
+
+const { SassRenderer } = require('@carbon/test-utils/scss');
+
+const { render } = SassRenderer.create(__dirname);
+
+describe('scss/components/skeleton-styles', () => {
+ test('Public API', async () => {
+ const { unwrap } = await render(`
+ @use 'sass:meta';
+ @use '../skeleton-styles';
+
+ $_: get('mixin', meta.mixin-exists('skeleton-styles', 'skeleton-styles'));
+ `);
+ expect(unwrap('mixin')).toBe(true);
+ });
+});
diff --git a/packages/styles/scss/components/_index.scss b/packages/styles/scss/components/_index.scss
index 8e3e319175ff..be53e497d243 100644
--- a/packages/styles/scss/components/_index.scss
+++ b/packages/styles/scss/components/_index.scss
@@ -41,6 +41,7 @@
@use 'radio-button';
@use 'search';
@use 'select';
+@use 'skeleton-styles';
@use 'slider';
@use 'structured-list';
@use 'tabs';
diff --git a/packages/styles/scss/components/skeleton-styles/_index.scss b/packages/styles/scss/components/skeleton-styles/_index.scss
new file mode 100644
index 000000000000..ac27686effa1
--- /dev/null
+++ b/packages/styles/scss/components/skeleton-styles/_index.scss
@@ -0,0 +1,11 @@
+//
+// Copyright IBM Corp. 2018, 2018
+//
+// This source code is licensed under the Apache-2.0 license found in the
+// LICENSE file in the root directory of this source tree.
+//
+
+@forward 'skeleton-styles';
+@use 'skeleton-styles';
+
+@include skeleton-styles.skeleton-styles;
diff --git a/packages/styles/scss/components/skeleton-styles/_skeleton-styles.scss b/packages/styles/scss/components/skeleton-styles/_skeleton-styles.scss
new file mode 100644
index 000000000000..3df659a7f009
--- /dev/null
+++ b/packages/styles/scss/components/skeleton-styles/_skeleton-styles.scss
@@ -0,0 +1,47 @@
+//
+// Copyright IBM Corp. 2016, 2018
+//
+// This source code is licensed under the Apache-2.0 license found in the
+// LICENSE file in the root directory of this source tree.
+//
+
+@use '../../config' as *;
+@use '../../utilities/skeleton' as *;
+@use '../../utilities/convert' as *;
+@use '../../spacing' as *;
+
+/// Skeleton styles
+/// @access public
+/// @group skeleton
+@mixin skeleton-styles {
+ //skeleton icon
+ .#{$prefix}--icon--skeleton {
+ @include skeleton;
+
+ display: inline-block;
+ width: rem(16px);
+ height: rem(16px);
+ }
+
+ //skeleton placeholder
+ .#{$prefix}--skeleton__placeholder {
+ @include skeleton;
+
+ width: rem(100px);
+
+ height: rem(100px);
+ }
+
+ //skeleton text
+ .#{$prefix}--skeleton__text {
+ @include skeleton;
+
+ width: 100%;
+ height: 1rem;
+ margin-bottom: $spacing-03;
+ }
+
+ .#{$prefix}--skeleton__heading {
+ height: 1.5rem;
+ }
+}