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

Material background on KTextbox #139

Merged
Merged
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
24 changes: 16 additions & 8 deletions lib/keen/UiTextbox.vue
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@
:readonly="readonly"
:required="required"
:step="stepValue"
:style="isActive ? { borderBottomColor: $themeTokens.primary } : {}"
:style="isActive ? { borderBottomColor: $themeTokens.primaryDark } : {}"
:tabindex="tabindex"
:type="type"
:value="value"
@@ -67,7 +67,7 @@
:required="required"

:rows="rows"
:style="isActive ? { borderBottomColor: $themeTokens.primary } : {}"
:style="isActive ? { borderBottomColor: $themeTokens.primaryDark } : {}"

:tabindex="tabindex"

@@ -84,14 +84,14 @@
v-if="label || $slots.default"
class="ui-textbox-label-text"
:class="labelClasses"
:style="isActive ? { color: $themeTokens.primary } : {}"
:style="isActive ? { color: $themeTokens.primaryDark } : {}"
>
<slot>{{ label }}</slot>
</div>
</label>

<div v-if="hasFeedback || maxlength" class="ui-textbox-feedback">
<div v-if="showError" class="ui-textbox-feedback-text">
<div v-if="showError" class="ui-textbox-feedback-text" style="{ color: $themeTokens.error }">
<slot name="error">
{{ error }}
</slot>
@@ -103,6 +103,12 @@
</slot>
</div>

<!-- Placeholder to keep the text height spacing in place even when
not showing any errors -->
<div v-else class="ui-textbox-feedback-text">
&nbsp;
</div>

<div v-if="maxlength" class="ui-textbox-counter">
{{ valueLength + '/' + maxlength }}
</div>
@@ -433,7 +439,8 @@
&.is-inline {
color: $ui-input-label-color; // So the hover styles don't override it
cursor: text;
transform: translateY($ui-input-label-top--inline) scale(1.1);
// 1em here is custom to keep text centered
transform: translateY(1em) scale(1.1);
}

&.is-floating {
@@ -490,8 +497,9 @@
display: flex;
flex-direction: column-reverse;
width: 100%;
padding: 0;
padding: 4px 0 0 0;
margin: 0;
border-radius: 4px 4px 0 0;
}

.ui-textbox-icon-wrapper {
@@ -509,7 +517,7 @@
}

.ui-textbox-label-text {
margin-bottom: $ui-input-label-margin-bottom;
margin: 0 8px 0;
font-size: $ui-input-label-font-size;
line-height: $ui-input-label-line-height;
color: $ui-input-label-color;
@@ -522,7 +530,7 @@
.ui-textbox-textarea {
display: block;
width: 100%;
padding: 0;
padding: 0 0 0 8px;
margin: 0;
font-size: $ui-input-text-font-size;
font-weight: normal;
2 changes: 1 addition & 1 deletion lib/styles/colorsDefault.js
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ export const defaultTokenMapping = {
appBarFullscreenDark: 'black',

// general semantic colors
error: 'palette.red.v_700',
error: 'palette.red.v_800',
success: 'palette.green.v_700',

// Kolibri-specific semantic colors