Skip to content

Commit

Permalink
Merge pull request #695 from salesforce-ux/hotfix/#162
Browse files Browse the repository at this point in the history
Form Element Breakpoint
  • Loading branch information
brandonferrua committed Mar 10, 2016
2 parents 7a10efa + 51df566 commit f7c4e49
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 84 deletions.
2 changes: 1 addition & 1 deletion RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ The following changes have been made in this release:
The following issues have now been resolved:

- Use relative paths to point to assets, fixes a bug where running SLDS in certain environments would fail to load assets - Fixes [design-system/issues/83](https://github.com/salesforce-ux/design-system/issues/83)

- Form element breakpoints now fire at small breakpoint rather than large breakpoint - Fixes [design-system/162](https://github.com/salesforce-ux/design-system/issues/162)


**DEPRECATED**
Expand Down
2 changes: 1 addition & 1 deletion site/assets/styles/_site/site-examples.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ iframe {
width: 100%;

&[data-form-factor="mobile"] {
width: 30rem;
width: calc(30rem - 1px); // Need this for preview to show what component looks like on < 480px, only important for mobile due to S1 needs
}

&[data-form-factor="tablet"] {
Expand Down
1 change: 1 addition & 0 deletions ui/components/forms/flavors/inline-form/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ status: 'dev-ready'
className: 'form--inline'
showFormFactors:
- small
- medium
- large
2 changes: 1 addition & 1 deletion ui/components/forms/flavors/inline-form/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
margin-top: $spacing-small;
}

@include mq-large-min {
@include mq-small-min {

.#{$css-prefix}form-element {
margin-right: $spacing-x-small;
Expand Down
86 changes: 86 additions & 0 deletions ui/dependencies/forms.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
// Copyright (c) 2015, salesforce.com, inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
// Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
// Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
// Neither the name of salesforce.com, inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

@mixin form-input-container {
background-color: $color-background-input;
color: $color-text-default;
border: $border-width-thin solid $color-border-input {
radius: $border-radius-medium;
};
width: 100%;
}

@mixin form-input-focus {
outline: 0;
border-color: $color-border-input-active;
background-color: $color-background-input-active;
box-shadow: $shadow-button-focus;
}

@mixin form-input-disabled {
background-color: $color-background-input-disabled;
border-color: $color-border-input-disabled;
cursor: not-allowed;
user-select: none;

&:focus,
&:active {
box-shadow: none;
}
}

@mixin form-element-vertical-spacing {
margin-top: $spacing-small;

@include mq-small-min {
margin-top: $spacing-x-small;
}
}

@mixin form-element-required($element: null) {
@if $element != null {
> #{$element}:before {
content: '*';
color: $color-text-error;
position: absolute;
left: ($spacing-x-small * -1);
}
}
}

@mixin form-input-error($element: null) {
@if $element != null {
#{$element} {
background-color: $color-background-input;
border-color: $color-border-error;
box-shadow: $color-border-error 0 0 0 $border-width-thin inset;
background-clip: padding-box;

&:focus,
&:active {
box-shadow: $color-border-error 0 0 0 $border-width-thin inset, $shadow-button-focus;
}
}
}
}

@mixin form-states {
@include form-input-container;
transition: border $duration-quickly linear, background-color $duration-quickly linear;

&:focus,
&:active {
@include form-input-focus;
}

&[disabled],
&.#{$css-prefix}is-disabled {
@include form-input-disabled;
}
}
1 change: 1 addition & 0 deletions ui/dependencies/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
'buttons',
'dropdowns',
'feed',
'forms',
'lists',
'popover',
'tables',
Expand Down
81 changes: 0 additions & 81 deletions ui/dependencies/interactions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,87 +54,6 @@
}



@mixin form-input-container {
background-color: $color-background-input;
color: $color-text-default;
border: $border-width-thin solid $color-border-input {
radius: $border-radius-medium;
};
width: 100%;
}

@mixin form-input-focus {
outline: 0;
border-color: $color-border-input-active;
background-color: $color-background-input-active;
box-shadow: $shadow-button-focus;
}

@mixin form-input-disabled {
background-color: $color-background-input-disabled;
border-color: $color-border-input-disabled;
cursor: not-allowed;
user-select: none;

&:focus,
&:active {
box-shadow: none;
}
}

@mixin form-element-vertical-spacing {
margin-top: $spacing-small;

@include mq-large-min {
margin-top: $spacing-x-small;
}
}

@mixin form-element-required($element: null) {
@if $element != null {
> #{$element}:before {
content: '*';
color: $color-text-error;
position: absolute;
left: ($spacing-x-small * -1);
}
}
}

@mixin form-input-error($element: null) {
@if $element != null {
#{$element} {
background-color: $color-background-input;
border-color: $color-border-error;
box-shadow: $color-border-error 0 0 0 $border-width-thin inset;
background-clip: padding-box;

&:focus,
&:active {
box-shadow: $color-border-error 0 0 0 $border-width-thin inset, $shadow-button-focus;
}
}
}
}

@mixin form-states {
@include form-input-container;
transition: border $duration-quickly linear, background-color $duration-quickly linear;

&:focus,
&:active {
@include form-input-focus;
}

&[disabled],
&.#{$css-prefix}is-disabled {
@include form-input-disabled;
}
}



@mixin calendar-selection-fill {
content: '';
position: absolute;
Expand Down

0 comments on commit f7c4e49

Please sign in to comment.