Skip to content

Commit

Permalink
fix(react): add class based APIs
Browse files Browse the repository at this point in the history
fixes #16583
  • Loading branch information
manucorporat committed Dec 10, 2018
1 parent 9167fb4 commit c23d0b0
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
1 change: 1 addition & 0 deletions core/src/css/normalize.scss
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ button div,
button span,
button ion-icon,
button ion-label,
.ion-tappable,
[tappable],
[tappable] div,
[tappable] span,
Expand Down
17 changes: 16 additions & 1 deletion core/src/css/padding.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ $margin: var(--ion-margin, 16px);
// Padding
// --------------------------------------------------

.ion-no-padding,
[no-padding] {
--padding-start: 0;
--padding-end: 0;
Expand All @@ -22,6 +23,7 @@ $margin: var(--ion-margin, 16px);
@include padding(0);
}

.ion-padding,
[padding] {
--padding-start: #{$padding};
--padding-end: #{$padding};
Expand All @@ -31,37 +33,43 @@ $margin: var(--ion-margin, 16px);
@include padding($padding);
}

.ion-padding-top,
[padding-top] {
--padding-top: #{$padding};

@include padding($padding, null, null, null);
}

.ion-padding-start,
[padding-start] {
--padding-start: #{$padding};

@include padding-horizontal($padding, null);
}

.ion-padding-end,
[padding-end] {
--padding-end: #{$padding};

@include padding-horizontal(null, $padding);
}

.ion-padding-bottom,
[padding-bottom] {
--padding-bottom: #{$padding};

@include padding(null, null, $padding, null);
}

.ion-padding-vertical,
[padding-vertical] {
--padding-top: #{$padding};
--padding-bottom: #{$padding};

@include padding($padding, null, $padding, null);
}

.ion-padding-horizontal,
[padding-horizontal] {
--padding-start: #{$padding};
--padding-end: #{$padding};
Expand All @@ -73,6 +81,7 @@ $margin: var(--ion-margin, 16px);
// Margin
// --------------------------------------------------

.ion-no-margin,
[no-margin] {
--margin-start: 0;
--margin-end: 0;
Expand All @@ -82,6 +91,7 @@ $margin: var(--ion-margin, 16px);
@include margin(0);
}

.ion-margin,
[margin] {
--margin-start: #{$margin};
--margin-end: #{$margin};
Expand All @@ -91,38 +101,43 @@ $margin: var(--ion-margin, 16px);
@include margin($margin);
}

.ion-margin-top,
[margin-top] {
--margin-top: #{$margin};

@include margin($margin, null, null, null);
}


.ion-margin-start,
[margin-start] {
--margin-start: #{$margin};

@include margin-horizontal($margin, null);
}

.ion-margin-end,
[margin-end] {
--margin-end: #{$margin};

@include margin-horizontal(null, $margin);
}

.ion-margin-bottom,
[margin-bottom] {
--margin-bottom: #{$margin};

@include margin(null, null, $margin, null);
}

.ion-margin-vertical,
[margin-vertical] {
--margin-top: #{$margin};
--margin-bottom: #{$margin};

@include margin($margin, null, $margin, null);
}

.ion-margin-horizontal,
[margin-horizontal] {
--margin-start: #{$margin};
--margin-end: #{$margin};
Expand Down
8 changes: 8 additions & 0 deletions core/src/css/text-alignment.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,42 @@
@include media-breakpoint-up($breakpoint, $screen-breakpoints) {
// Provide `[text-{bp}]` attributes for aligning the text based
// on the breakpoint
.ion-text#{$infix}-center,
[text#{$infix}-center] {
text-align: center !important;
}

.ion-text#{$infix}-justify,
[text#{$infix}-justify] {
text-align: justify !important;
}

.ion-text#{$infix}-start,
[text#{$infix}-start] {
text-align: start !important;
}

.ion-text#{$infix}-end,
[text#{$infix}-end] {
text-align: end !important;
}

.ion-text#{$infix}-left,
[text#{$infix}-left] {
text-align: left !important;
}

.ion-text#{$infix}-right,
[text#{$infix}-right] {
text-align: right !important;
}

.ion-text#{$infix}-nowrap,
[text#{$infix}-nowrap] {
white-space: nowrap !important;
}

.ion-text#{$infix}-wrap,
[text#{$infix}-wrap] {
white-space: normal !important;
}
Expand Down
3 changes: 3 additions & 0 deletions core/src/css/text-transformation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,19 @@
@include media-breakpoint-up($breakpoint, $screen-breakpoints) {
// Provide `[text-{bp}]` attributes for transforming the text based
// on the breakpoint
.ion-text#{$infix}-uppercase,
[text#{$infix}-uppercase] {
/* stylelint-disable-next-line declaration-no-important */
text-transform: uppercase !important;
}

.ion-text#{$infix}-lowercase,
[text#{$infix}-lowercase] {
/* stylelint-disable-next-line declaration-no-important */
text-transform: lowercase !important;
}

.ion-text#{$infix}-capitalize,
[text#{$infix}-capitalize] {
/* stylelint-disable-next-line declaration-no-important */
text-transform: capitalize !important;
Expand Down

0 comments on commit c23d0b0

Please sign in to comment.