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(CodeSnippet): set number of closed and open rows #7826

Closed
wants to merge 15 commits into from
Closed
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
@@ -1,5 +1,5 @@
//
// Copyright IBM Corp. 2016, 2018
// Copyright IBM Corp. 2016, 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 @@ -201,17 +201,19 @@
.#{$prefix}--snippet--multi .#{$prefix}--snippet-container {
position: relative;
order: 1;
min-height: rem(56px);
max-height: rem(238px);
overflow: hidden;
width: 100%;
overflow: scroll;
transition: max-height $duration--moderate-01 motion(standard, productive);
}

.#{$prefix}--snippet--multi.#{$prefix}--snippet--wraptext
.#{$prefix}--snippet-container {
overflow-x: hidden;
}

// expanded snippet container
.#{$prefix}--snippet--multi.#{$prefix}--snippet--expand
.#{$prefix}--snippet-container {
max-height: 100%;
padding-bottom: $spacing-05;
transition: max-height $duration--moderate-01 motion(standard, productive);
}

Expand All @@ -220,27 +222,8 @@
word-wrap: break-word;
}

// closed pre
.#{$prefix}--snippet--multi .#{$prefix}--snippet-container pre {
padding-right: $carbon--spacing-08;
padding-bottom: rem(24px);
overflow-x: auto;
}

.#{$prefix}--snippet--multi.#{$prefix}--snippet--no-copy
.#{$prefix}--snippet-container
pre {
padding-right: 0;
}

// expanded pre
.#{$prefix}--snippet--multi.#{$prefix}--snippet--expand
.#{$prefix}--snippet-container
pre {
overflow-x: auto;
}

.#{$prefix}--snippet--multi .#{$prefix}--snippet-container pre::after {
// .#{$prefix}--snippet--multi .#{$prefix}--snippet-container::after {
position: absolute;
top: 0;
right: 0;
Expand Down
18 changes: 12 additions & 6 deletions packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -337,12 +337,6 @@ Map {
"render": [Function],
},
"CodeSnippet" => Object {
"defaultProps": Object {
"showLessText": "Show less",
"showMoreText": "Show more",
"type": "single",
"wrapText": false,
},
"propTypes": Object {
"ariaLabel": Object {
"type": "string",
Expand Down Expand Up @@ -371,6 +365,18 @@ Map {
"light": Object {
"type": "bool",
},
"maxClosedNumberOfRows": Object {
"type": "number",
},
"maxExpandedNumberOfRows": Object {
"type": "number",
},
"minClosedNumberOfRows": Object {
"type": "number",
},
"minExpandedNumberOfRows": Object {
"type": "number",
},
"onClick": Object {
"type": "func",
},
Expand Down
Loading