Skip to content
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
9 changes: 9 additions & 0 deletions core/src/components/input/input.ios.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@
.input-clear-icon {
@include svg-background-image($input-ios-input-clear-icon-svg);

@supports (mask-image: url()) {
@include svg-mask-image($input-ios-input-clear-icon-svg);
background-color: $input-ios-input-clear-icon-color;
background-image: none;
mask-size: $input-ios-input-clear-icon-size;
mask-repeat: no-repeat;
mask-position: center;
}

width: $input-ios-input-clear-icon-width;
height: $input-ios-input-clear-icon-width;

Expand Down
10 changes: 9 additions & 1 deletion core/src/components/input/input.md.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
@import "./input";
@import "./input.md.vars";


// Material Design Input
// --------------------------------------------------

Expand All @@ -24,6 +23,15 @@
.input-clear-icon {
@include svg-background-image($input-md-input-clear-icon-svg);

@supports (mask-image: url()) {
@include svg-mask-image($input-md-input-clear-icon-svg);
background-color: $input-md-input-clear-icon-color;
background-image: none;
mask-size: $input-md-input-clear-icon-size;
mask-repeat: no-repeat;
mask-position: center;
}

width: $input-md-input-clear-icon-width;
height: $input-md-input-clear-icon-width;

Expand Down
9 changes: 9 additions & 0 deletions core/src/components/input/test/basic/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@
></ion-input>
</ion-item>

<ion-item>
<ion-label>Colored Clear Input</ion-label>
<ion-input
clear-input
value="reallylonglonglonginputtoseetheedgesreallylonglonglonginputtoseetheedges"
style="--ion-color-step-600: var(--ion-color-primary, #3880ff)"
></ion-input>
</ion-item>

<ion-item color="dark">
<ion-label position="floating">Floating</ion-label>
<ion-input checked></ion-input>
Expand Down
27 changes: 21 additions & 6 deletions core/src/themes/ionic.mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -206,16 +206,17 @@
}


// SVG Background Image Mixin
// SVG Image Mixin
// @param {string} $property
// @param {string} $svg
// ----------------------------------------------------------
@mixin svg-background-image($svg, $flip-rtl: false) {
@mixin svg-property-value($property, $svg, $flip-rtl: false) {
$url: url-encode($svg);
$viewBox: str-split(str-extract($svg, "viewBox='", "'"), " ");

@if $flip-rtl != true or $viewBox == null {
@include multi-dir() {
background-image: url("data:image/svg+xml;charset=utf-8,#{$url}");
#{$property}: url("data:image/svg+xml;charset=utf-8,#{$url}");
}
} @else {
$transform: "transform='translate(#{nth($viewBox, 3)}, 0) scale(-1, 1)'";
Expand All @@ -225,15 +226,29 @@
$flipped-url: str-replace($flipped-url, "<polygon", "<polygon #{$transform}");
$flipped-url: url-encode($flipped-url);

@include ltr () {
background-image: url("data:image/svg+xml;charset=utf-8,#{$url}");
@include ltr() {
#{$property}: url("data:image/svg+xml;charset=utf-8,#{$url}");
}
@include rtl() {
background-image: url("data:image/svg+xml;charset=utf-8,#{$flipped-url}");
#{$property}: url("data:image/svg+xml;charset=utf-8,#{$flipped-url}");
}
}
}

// SVG Background Image Mixin
// @param {string} $svg
// ----------------------------------------------------------
@mixin svg-background-image($svg, $flip-rtl: false) {
@include svg-property-value(background-image, $svg, $flip-rtl);
}

// SVG Mask Image Mixin
// @param {string} $svg
// ----------------------------------------------------------
@mixin svg-mask-image($svg, $flip-rtl: false) {
@include svg-property-value(mask-image, $svg, $flip-rtl);
}

// Add property horizontal
// @param {string} $start
// @param {string} $end
Expand Down