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 editable text classes #2413

Merged
merged 3 commits into from
Apr 20, 2018
Merged
Changes from 1 commit
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
28 changes: 14 additions & 14 deletions packages/core/src/components/editable-text/_editable-text.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@

@each $intent, $color in $pt-intent-colors {
&.#{$ns}-intent-#{$intent} {
.#{$ns}-editable-input,
.#{$ns}-editable-content {
.#{$ns}-editable-text-input,
.#{$ns}-editable-text-content {
color: $color;
}

&:hover::before {
box-shadow: input-transition-shadow($color), inset border-shadow(0.4, $color, 1px);
}

&.#{$ns}-editable-editing::before {
&.#{$ns}-editable-text-editing::before {
box-shadow: input-transition-shadow($color, true), $input-box-shadow-focus;
}
}
Expand All @@ -58,7 +58,7 @@
inset 0 0 0 1px $pt-dark-divider-white;
}

&.#{$ns}-editable-editing::before {
&.#{$ns}-editable-text-editing::before {
box-shadow: input-transition-shadow($dark-input-shadow-color-focus, true),
$pt-dark-input-box-shadow;
background-color: $dark-input-background-color;
Expand All @@ -70,24 +70,24 @@

@each $intent, $color in $pt-dark-intent-text-colors {
&.#{$ns}-intent-#{$intent} {
.#{$ns}-editable-content {
.#{$ns}-editable-text-content {
color: $color;
}

&:hover::before {
box-shadow: input-transition-shadow($color), inset border-shadow(0.4, $color, 1px);
}

&.#{$ns}-editable-editing::before {
&.#{$ns}-editable-text-editing::before {
box-shadow: input-transition-shadow($color, true), $pt-dark-input-box-shadow;
}
}
}
}
}

.#{$ns}-editable-input,
.#{$ns}-editable-content {
.#{$ns}-editable-text-input,
.#{$ns}-editable-text-content {
display: inherit;
position: relative;
// inherit and respect parent bounds and text styles
Expand All @@ -102,7 +102,7 @@
resize: none;
}

.#{$ns}-editable-input {
.#{$ns}-editable-text-input {
// reset browser input styles (we're using an input solely because you can type in it)
border: none;
box-shadow: none;
Expand All @@ -121,21 +121,21 @@
}
}

.#{$ns}-editable-content {
.#{$ns}-editable-text-content {
overflow: hidden;
// magical number to account for slight increase in input width for cursor bar
padding-right: 2px;
text-overflow: ellipsis;
// preserve so trailing whitespace is included in scrollWidth
white-space: pre;

.#{$ns}-editable-editing > & {
.#{$ns}-editable-text-editing > & {
position: absolute;
left: 0;
visibility: hidden;
}

.#{$ns}-editable-placeholder > & {
.#{$ns}-editable-text-placeholder > & {
color: $input-placeholder-color;

.#{$ns}-dark & {
Expand All @@ -144,10 +144,10 @@
}
}

.#{$ns}-editable-text.#{$ns}-multiline {
.#{$ns}-editable-text-text.#{$ns}-multiline {
display: block;

.#{$ns}-editable-content {
.#{$ns}-editable-text-content {
overflow: auto;
white-space: pre-wrap;
word-wrap: break-word;
Expand Down