Skip to content

Commit

Permalink
Merge branch 'master' into refactor/update-icon-metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
joshblack authored Feb 18, 2020
2 parents 638b72c + e78bbb5 commit f623000
Show file tree
Hide file tree
Showing 17 changed files with 120 additions and 36 deletions.
38 changes: 20 additions & 18 deletions packages/components/docs/sass.md
Original file line number Diff line number Diff line change
Expand Up @@ -3675,7 +3675,6 @@ $spacing-04: $carbon--spacing-04;
- **Used by**:
- [carbon--theme [mixin]](#carbon--theme-mixin)
- [data-table-core [mixin]](#data-table-core-mixin)
- [data-table-sort [mixin]](#data-table-sort-mixin)
- [tabs [mixin]](#tabs-mixin)

### ✅spacing-05 [variable]
Expand All @@ -3700,6 +3699,7 @@ $spacing-05: $carbon--spacing-05;
- [data-table-v2-action [mixin]](#data-table-v2-action-mixin)
- [data-table-core [mixin]](#data-table-core-mixin)
- [data-table-expandable [mixin]](#data-table-expandable-mixin)
- [data-table-sort [mixin]](#data-table-sort-mixin)
- [modal [mixin]](#modal-mixin)
- [pagination [mixin]](#pagination-mixin)
- [select [mixin]](#select-mixin)
Expand Down Expand Up @@ -6112,8 +6112,6 @@ $ui-background: if(
- **Type**: `{undefined}`
- **Used by**:
- [carbon--theme [mixin]](#carbon--theme-mixin)
- [dropdown [mixin]](#dropdown-mixin)
- [listbox [mixin]](#listbox-mixin)
- [tooltip [mixin]](#tooltip-mixin)

### ✅ui-01 [variable]
Expand Down Expand Up @@ -7500,7 +7498,7 @@ $hover-danger: if(
'hover-danger'
),
map-get($carbon--theme, 'hover-danger'),
#ba1b23
#b81921
);
```

Expand Down Expand Up @@ -14921,8 +14919,8 @@ Data table core styles

.#{$prefix}--data-table th,
.#{$prefix}--data-table td {
padding-left: $spacing-04;
padding-right: $spacing-04;
padding-left: $spacing-05;
padding-right: $spacing-05;
vertical-align: top;
text-align: left;
}
Expand Down Expand Up @@ -14954,7 +14952,7 @@ Data table core styles
color: $text-02;
border-top: 1px solid $ui-01;
border-bottom: 1px solid $ui-03;
padding: rem(14px) $spacing-04;
padding: rem(14px) $spacing-05;
padding-bottom: rem(13px);

& + td:first-of-type {
Expand Down Expand Up @@ -15783,12 +15781,12 @@ Data table sort styles
}

.#{$prefix}--data-table--sort td {
padding-left: $spacing-03;
padding-right: $spacing-03;
padding-left: $spacing-05;
padding-right: $spacing-05;
}

.#{$prefix}--data-table--sort th:first-of-type .#{$prefix}--table-sort {
padding-left: $spacing-04;
padding-left: $spacing-05;
}

// -------------------------------------
Expand All @@ -15803,7 +15801,7 @@ Data table sort styles
justify-content: space-between;
width: 100%;
color: $text-01;
padding: 0 $spacing-03;
padding: 0 $spacing-05;
height: 100%;
background-color: $ui-03;
transition: background-color $duration--fast-01 motion(entrance, productive),
Expand Down Expand Up @@ -15944,10 +15942,10 @@ Data table sort styles
- **Requires**:
- [prefix [variable]](#prefix-variable)
- [layout-04 [variable]](#layout-04-variable)
- [spacing-03 [variable]](#spacing-03-variable)
- [spacing-04 [variable]](#spacing-04-variable)
- [spacing-05 [variable]](#spacing-05-variable)
- [text-01 [variable]](#text-01-variable)
- [ui-03 [variable]](#ui-03-variable)
- [spacing-03 [variable]](#spacing-03-variable)
- [ui-05 [variable]](#ui-05-variable)
- [layout-01 [variable]](#layout-01-variable)

Expand Down Expand Up @@ -16791,15 +16789,15 @@ Dropdown styles
border-bottom-color: transparent;
width: auto;
height: rem(32px);
background-color: $ui-background;
background-color: transparent;
transition: background $duration--fast-01 motion(entrance, productive);

&:hover {
background-color: $hover-ui;
}

&.#{$prefix}--dropdown--disabled {
background-color: $ui-background;
background-color: transparent;
}

.#{$prefix}--dropdown__arrow {
Expand Down Expand Up @@ -16898,7 +16896,6 @@ Dropdown styles
- [selected-ui [variable]](#selected-ui-variable)
- [text-02 [variable]](#text-02-variable)
- [disabled-02 [variable]](#disabled-02-variable)
- [ui-background [variable]](#ui-background-variable)
- [carbon--spacing-04 [variable]](#carbon--spacing-04-variable)

## file-uploader
Expand Down Expand Up @@ -17855,7 +17852,7 @@ List box styles

// Inline variant for a `list-box`
.#{$prefix}--list-box.#{$prefix}--list-box--inline {
background-color: $ui-background;
background-color: transparent;
border-width: 0;

&:hover {
Expand Down Expand Up @@ -18002,6 +17999,9 @@ List box styles
.#{$prefix}--list-box__selection {
position: absolute;
right: rem(33px); // to preserve .5rem space between icons according to spec
// top/transform used to center invalid icon in IE11
top: 50%;
transform: translateY(-50%);
display: flex;
justify-content: center;
align-items: center;
Expand Down Expand Up @@ -18287,7 +18287,6 @@ List box styles
- [support-01 [variable]](#support-01-variable)
- [disabled-02 [variable]](#disabled-02-variable)
- [carbon--spacing-09 [variable]](#carbon--spacing-09-variable)
- [ui-background [variable]](#ui-background-variable)
- [carbon--spacing-03 [variable]](#carbon--spacing-03-variable)
- [carbon--spacing-07 [variable]](#carbon--spacing-07-variable)
- [carbon--spacing-05 [variable]](#carbon--spacing-05-variable)
Expand Down Expand Up @@ -22563,6 +22562,9 @@ Text input styles
.#{$prefix}--text-input__invalid-icon {
position: absolute;
right: $carbon--spacing-05;
// top/transform used to center invalid icon in IE11
top: 50%;
transform: translateY(-50%);
fill: $support-01;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
@import '../../globals/scss/vars';
@import '../../globals/scss/vendor/@carbon/elements/scss/import-once/import-once';
@import '../list-box/list-box';
@import '../../globals/scss/css--reset';

/// Combo box styles
/// @access private
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@

.#{$prefix}--data-table th,
.#{$prefix}--data-table td {
padding-left: $spacing-04;
padding-right: $spacing-04;
padding-left: $spacing-05;
padding-right: $spacing-05;
vertical-align: top;
text-align: left;
}
Expand Down Expand Up @@ -120,7 +120,7 @@
color: $text-02;
border-top: 1px solid $ui-01;
border-bottom: 1px solid $ui-03;
padding: rem(14px) $spacing-04;
padding: rem(14px) $spacing-05;
padding-bottom: rem(13px);

& + td:first-of-type {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
}

.#{$prefix}--data-table--sort td {
padding-left: $spacing-03;
padding-right: $spacing-03;
padding-left: $spacing-05;
padding-right: $spacing-05;
}

.#{$prefix}--data-table--sort th:first-of-type .#{$prefix}--table-sort {
padding-left: $spacing-04;
padding-left: $spacing-05;
}

// -------------------------------------
Expand All @@ -49,7 +49,7 @@
justify-content: space-between;
width: 100%;
color: $text-01;
padding: 0 $spacing-03;
padding: 0 $spacing-05;
height: 100%;
background-color: $ui-03;
transition: background-color $duration--fast-01 motion(entrance, productive),
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/components/dropdown/_dropdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -343,15 +343,15 @@
border-bottom-color: transparent;
width: auto;
height: rem(32px);
background-color: $ui-background;
background-color: transparent;
transition: background $duration--fast-01 motion(entrance, productive);

&:hover {
background-color: $hover-ui;
}

&.#{$prefix}--dropdown--disabled {
background-color: $ui-background;
background-color: transparent;
}

.#{$prefix}--dropdown__arrow {
Expand Down
5 changes: 4 additions & 1 deletion packages/components/src/components/list-box/_list-box.scss
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ $list-box-menu-width: rem(300px);

// Inline variant for a `list-box`
.#{$prefix}--list-box.#{$prefix}--list-box--inline {
background-color: $ui-background;
background-color: transparent;
border-width: 0;

&:hover {
Expand Down Expand Up @@ -343,6 +343,9 @@ $list-box-menu-width: rem(300px);
.#{$prefix}--list-box__selection {
position: absolute;
right: rem(33px); // to preserve .5rem space between icons according to spec
// top/transform used to center invalid icon in IE11
top: 50%;
transform: translateY(-50%);
display: flex;
justify-content: center;
align-items: center;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@
.#{$prefix}--text-input__invalid-icon {
position: absolute;
right: $carbon--spacing-05;
// top/transform used to center invalid icon in IE11
top: 50%;
transform: translateY(-50%);
fill: $support-01;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/elements/docs/sass.md
Original file line number Diff line number Diff line change
Expand Up @@ -6832,7 +6832,7 @@ $hover-danger: if(
'hover-danger'
),
map-get($carbon--theme, 'hover-danger'),
#ba1b23
#b81921
);
```

Expand Down
2 changes: 1 addition & 1 deletion packages/themes/docs/sass.md
Original file line number Diff line number Diff line change
Expand Up @@ -3326,7 +3326,7 @@ $hover-danger: if(
'hover-danger'
),
map-get($carbon--theme, 'hover-danger'),
#ba1b23
#b81921
);
```

Expand Down
3 changes: 2 additions & 1 deletion packages/themes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"dependencies": {
"@carbon/colors": "^10.7.0",
"@carbon/layout": "^10.7.0",
"@carbon/type": "^10.8.0"
"@carbon/type": "^10.8.0",
"color": "^3.1.2"
},
"devDependencies": {
"@carbon/cli-reporter": "10.3.0",
Expand Down
43 changes: 43 additions & 0 deletions packages/themes/src/__tests__/tools-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/**
* Copyright IBM Corp. 2018, 2018
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*
* @jest-environment node
*/

import Color from 'color';
import { adjustLightness } from '../tools';
import { blue60 } from '@carbon/colors';

describe('tools', () => {
describe('adjustLightness', () => {
const SHIFT_AMOUNT = 5;

const baseColor = Color(blue60);
const baseLightness = baseColor
.hsl()
.round()
.object().l;

it('should increase lightness by a specified amount', () => {
const newColor = Color(adjustLightness(blue60, SHIFT_AMOUNT));
const newLightness = newColor
.hsl()
.round()
.object().l;
expect(newLightness).toEqual(baseLightness + SHIFT_AMOUNT);
});

it('should decrease lightness by a specified amount when given a negative shift', () => {
const newColor = Color(adjustLightness(blue60, SHIFT_AMOUNT * -1));
const newLightness = newColor
.hsl()
.round()
.object().l;

expect(newLightness).toEqual(baseLightness - SHIFT_AMOUNT);
});
});
});
3 changes: 2 additions & 1 deletion packages/themes/src/g10.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
import { adjustLightness } from './tools';

import {
// Blue
Expand Down Expand Up @@ -111,7 +112,7 @@ export const inverseHoverUI = '#4c4c4c';

export const hoverSelectedUI = '#cacaca';

export const hoverDanger = '#ba1b23';
export const hoverDanger = adjustLightness(danger, -8);
export const activeDanger = red80;

export const hoverRow = '#e5e5e5';
Expand Down
3 changes: 2 additions & 1 deletion packages/themes/src/g100.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
import { adjustLightness } from './tools';

import {
// Blue
Expand Down Expand Up @@ -110,7 +111,7 @@ export const inverseHoverUI = '#e5e5e5';

export const hoverSelectedUI = '#4c4c4c';

export const hoverDanger = '#ba1b23';
export const hoverDanger = adjustLightness(danger, -8);
export const activeDanger = red80;

export const hoverRow = '#353535';
Expand Down
3 changes: 2 additions & 1 deletion packages/themes/src/g90.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
import { adjustLightness } from './tools';

import {
// Blue
Expand Down Expand Up @@ -111,7 +112,7 @@ export const inverseHoverUI = '#e5e5e5';

export const hoverSelectedUI = '#656565';

export const hoverDanger = '#ba1b23';
export const hoverDanger = adjustLightness(danger, -8);
export const activeDanger = red80;

export const hoverRow = '#4c4c4c';
Expand Down
Loading

0 comments on commit f623000

Please sign in to comment.