Skip to content

Commit

Permalink
Fix EuiCodeBlock padding for scrollbar
Browse files Browse the repository at this point in the history
  • Loading branch information
cchaos committed Jan 2, 2020
1 parent 32b7bef commit 40ac201
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/components/code/_code_block.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
font-size: inherit;
}

&.euiCodeBlock--hasControls {
padding-right: $euiSizeL + $euiSizeXS;
}

.euiCodeBlock__controls {
position: absolute;
top: 0;
Expand Down Expand Up @@ -64,6 +60,8 @@
font-size: $euiFontSize;
}

$controlsPadding: $euiSizeL + $euiSizeXS;

// Small padding
&.euiCodeBlock--paddingSmall {
.euiCodeBlock__pre {
Expand All @@ -74,6 +72,10 @@
top: $euiSizeS;
right: $euiSizeS;
}

&.euiCodeBlock--hasControls .euiCodeBlock__pre {
padding-right: $euiSizeS + $controlsPadding;
}
}

// Medium padding
Expand All @@ -86,6 +88,10 @@
top: $euiSize;
right: $euiSize;
}

&.euiCodeBlock--hasControls .euiCodeBlock__pre {
padding-right: $euiSize + $controlsPadding;
}
}

// Large padding
Expand All @@ -98,6 +104,10 @@
top: $euiSizeL;
right: $euiSizeL;
}

&.euiCodeBlock--hasControls .euiCodeBlock__pre {
padding-right: $euiSizeL + $controlsPadding;
}
}

/**
Expand Down

0 comments on commit 40ac201

Please sign in to comment.