Skip to content

Commit

Permalink
feat(inputs): modify input color based on container background (#5598)
Browse files Browse the repository at this point in the history
* feat(inputs): modify background based on container

#4826

* fix(inputs): un-nest styles for inputs in tile/tabs containers

* fix(tabs): target inputs via general sibling combinator selector

* fix(tabs): add input to container story

Co-authored-by: Josh Black <[email protected]>
Co-authored-by: TJ Egan <[email protected]>
Co-authored-by: Alessandra Davila <[email protected]>
  • Loading branch information
4 people authored Apr 2, 2020
1 parent 33bc00b commit 8b6cdd1
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
26 changes: 26 additions & 0 deletions packages/components/src/components/tabs/_tabs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,32 @@
padding: $carbon--spacing-05;
}

.#{$prefix}--tabs--container
~ .#{$prefix}--tab-content
.#{$prefix}--text-input,
.#{$prefix}--tabs--container
~ .#{$prefix}--tab-content
.#{$prefix}--text-area,
.#{$prefix}--tabs--container
~ .#{$prefix}--tab-content
.#{$prefix}--search-input,
.#{$prefix}--tabs--container
~ .#{$prefix}--tab-content
.#{$prefix}--select-input,
.#{$prefix}--tabs--container ~ .#{$prefix}--tab-content .#{$prefix}--dropdown,
.#{$prefix}--tabs--container
~ .#{$prefix}--tab-content
.#{$prefix}--dropdown-list,
.#{$prefix}--tabs--container
~ .#{$prefix}--tab-content
.#{$prefix}--number
input[type='number'],
.#{$prefix}--tabs--container
~ .#{$prefix}--tab-content
.#{$prefix}--date-picker__input {
background-color: $field-02;
}

//-----------------------------
// Skeleton state
//-----------------------------
Expand Down
11 changes: 11 additions & 0 deletions packages/components/src/components/tile/_tile.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@
}
}

.#{$prefix}--tile .#{$prefix}--text-input,
.#{$prefix}--tile .#{$prefix}--text-area,
.#{$prefix}--tile .#{$prefix}--search-input,
.#{$prefix}--tile .#{$prefix}--select-input,
.#{$prefix}--tile .#{$prefix}--dropdown,
.#{$prefix}--tile .#{$prefix}--dropdown-list,
.#{$prefix}--tile .#{$prefix}--number input[type='number'],
.#{$prefix}--tile .#{$prefix}--date-picker__input {
background-color: $field-02;
}

.#{$prefix}--tile--light {
background-color: $ui-02;
}
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/Tabs/Tabs-story.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import './Tabs-story.scss';
import CodeSnippet from '../CodeSnippet';
import Tabs from '../Tabs';
import Tab from '../Tab';
import TextInput from '../TextInput';
import TabsSkeleton from '../Tabs/Tabs.Skeleton';

const selectionModes = {
Expand Down Expand Up @@ -199,6 +200,7 @@ storiesOf('Tabs', module)
label={<CustomLabel text="Custom Label" />}>
<div className="some-content">
<p>Content for fourth tab goes here.</p>
<TextInput id="sample-input" labelText="text input label" />
</div>
</Tab>
</Tabs>
Expand Down

0 comments on commit 8b6cdd1

Please sign in to comment.