Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(TOC): update mobile sticky position when scrolling #4953

Merged
merged 1 commit into from
Jan 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import { html } from 'lit-element';
import ArrowRight20 from 'carbon-web-components/es/icons/arrow--right/20';
import contentStyles from 'carbon-components/scss/components/ui-shell/_content.scss';
import logosGroup from '../../../logo-grid/__stories__/data/logos.js';

import imgSm16x9 from '../../../../../../storybook-images/assets/320/fpo--16x9--320x180--002.jpg';
Expand Down Expand Up @@ -91,9 +90,6 @@ const cardGroupItems = html`
`;

const StoryContent = () => html`
<style type="text/css">
${contentStyles.cssText}
</style>
<main class="bx--content dds-ce-demo-devenv--ui-shell-content">
<div class="bx--grid">
<div class="bx--row">
Expand Down Expand Up @@ -171,8 +167,8 @@ const StoryContent = () => html`
<dds-callout-with-media>
<dds-content-block-heading slot="heading">Mauris ultrices eros in cursus</dds-content-block-heading>
<dds-content-item-copy
>Porttitor eget dolor morbi non arcu. Et ligula ullamcorper malesuada proin libero nunc consequat.
In est ante in nibh mauris cursus mattis. Turpis tincidunt id aliquet risus feugiat in.
>Porttitor eget dolor morbi non arcu. Et ligula ullamcorper malesuada proin libero nunc consequat.
In est ante in nibh mauris cursus mattis. Turpis tincidunt id aliquet risus feugiat in.
Vel facilisis volutpat est velit egestas dui.
</dds-content-item-copy>
<dds-callout-with-media-video video-id="1_9h94wo6b"></dds-callout-with-media-video>
Expand Down Expand Up @@ -206,7 +202,7 @@ const StoryContent = () => html`
${Array.from([1, 2, 3]).map(() => cardGroupItems)}
</dds-card-group>
</dds-content-block-cards>

<dds-callout-quote>
Duis aute irure dolor in reprehenderit
<dds-quote-source-heading>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright IBM Corp. 2020
// Copyright IBM Corp. 2020, 2021
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
Expand All @@ -22,12 +22,16 @@
}
}

.bx--content.dds-ce-demo-devenv--ui-shell-content {
h2 {
margin: 30px 0;
.bx--content {
padding: 6rem 0 2rem;

&:first-of-type {
margin-top: 0;
&.dds-ce-demo-devenv--ui-shell-content {
h2 {
margin: 30px 0;

&:first-of-type {
margin-top: 0;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright IBM Corp. 2020
// Copyright IBM Corp. 2020, 2021
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
Expand Down Expand Up @@ -28,6 +28,10 @@

.#{$dds-prefix}-ce--table-of-contents__container {
@include carbon--make-row();

.#{$prefix}--tableofcontents__sidebar {
top: 48px;
}
}

.#{$dds-prefix}-ce--table-of-contents__items-container {
Expand Down