Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(color): Improve the library size for webpack #204

Merged
merged 6 commits into from
Jun 23, 2017
Merged
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
341 changes: 178 additions & 163 deletions docs/assets/polished.js

Large diffs are not rendered by default.

135 changes: 68 additions & 67 deletions docs/docs/index.html

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion src/color/adjustHue.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ function adjustHue(degree: number, color: string): string {
})
}

export default curry(adjustHue)
// Don’t inline this variable into export because Rollup will remove the /*#__PURE__*/ comment
const curriedAdjustHue = /*#__PURE__*/curry(adjustHue) // eslint-disable-line spaced-comment
export default curriedAdjustHue
4 changes: 3 additions & 1 deletion src/color/darken.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ function darken(amount: number, color: string): string {
})
}

export default curry(darken)
// Don’t inline this variable into export because Rollup will remove the /*#__PURE__*/ comment
const curriedDarken = /*#__PURE__*/curry(darken) // eslint-disable-line spaced-comment
export default curriedDarken
4 changes: 3 additions & 1 deletion src/color/desaturate.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@ function desaturate(amount: number, color: string): string {
})
}

export default curry(desaturate)
// Don’t inline this variable into export because Rollup will remove the /*#__PURE__*/ comment
const curriedDesaturate = /*#__PURE__*/curry(desaturate) // eslint-disable-line spaced-comment
export default curriedDesaturate
4 changes: 3 additions & 1 deletion src/color/lighten.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ function lighten(amount: number, color: string): string {
})
}

export default curry(lighten)
// Don’t inline this variable into export because Rollup will remove the /*#__PURE__*/ comment
const curriedLighten = /*#__PURE__*/curry(lighten) // eslint-disable-line spaced-comment
export default curriedLighten
4 changes: 3 additions & 1 deletion src/color/mix.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,6 @@ function mix(weight: number = 0.5, color: string, otherColor: string): string {
return rgba(mixedColor)
}

export default curry(mix)
// Don’t inline this variable into export because Rollup will remove the /*#__PURE__*/ comment
const curriedMix = /*#__PURE__*/curry(mix) // eslint-disable-line spaced-comment
export default curriedMix
4 changes: 3 additions & 1 deletion src/color/opacify.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,6 @@ function opacify(amount: number, color: string) {
return rgba(colorWithAlpha)
}

export default curry(opacify)
// Don’t inline this variable into export because Rollup will remove the /*#__PURE__*/ comment
const curriedOpacify = /*#__PURE__*/curry(opacify) // eslint-disable-line spaced-comment
export default curriedOpacify
4 changes: 3 additions & 1 deletion src/color/saturate.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,6 @@ function saturate(amount: number, color: string): string {
})
}

export default curry(saturate)
// Don’t inline this variable into export because Rollup will remove the /*#__PURE__*/ comment
const curriedSaturate = /*#__PURE__*/curry(saturate) // eslint-disable-line spaced-comment
export default curriedSaturate
4 changes: 3 additions & 1 deletion src/color/setHue.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ function setHue(hue: number, color: string): string {
})
}

export default curry(setHue)
// Don’t inline this variable into export because Rollup will remove the /*#__PURE__*/ comment
const curriedSetHue = /*#__PURE__*/curry(setHue) // eslint-disable-line spaced-comment
export default curriedSetHue
4 changes: 3 additions & 1 deletion src/color/setLightness.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ function setLightness(lightness: number, color: string): string {
})
}

export default curry(setLightness)
// Don’t inline this variable into export because Rollup will remove the /*#__PURE__*/ comment
const curriedSetLightness = /*#__PURE__*/curry(setLightness) // eslint-disable-line spaced-comment
export default curriedSetLightness
4 changes: 3 additions & 1 deletion src/color/setSaturation.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ function setSaturation(saturation: number, color: string): string {
})
}

export default curry(setSaturation)
// Don’t inline this variable into export because Rollup will remove the /*#__PURE__*/ comment
const curriedSetSaturation = /*#__PURE__*/curry(setSaturation) // eslint-disable-line spaced-comment
export default curriedSetSaturation
4 changes: 3 additions & 1 deletion src/color/shade.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@ function shade(percentage: number, color: string) {
return mix(percentage, color, 'rgb(0, 0, 0)')
}

export default curry(shade)
// Don’t inline this variable into export because Rollup will remove the /*#__PURE__*/ comment
const curriedShade = /*#__PURE__*/curry(shade) // eslint-disable-line spaced-comment
export default curriedShade
4 changes: 3 additions & 1 deletion src/color/tint.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@ function tint(percentage: number, color: string) {
return mix(percentage, color, 'rgb(255, 255, 255)')
}

export default curry(tint)
// Don’t inline this variable into export because Rollup will remove the /*#__PURE__*/ comment
const curriedTint = /*#__PURE__*/curry(tint) // eslint-disable-line spaced-comment
export default curriedTint
4 changes: 3 additions & 1 deletion src/color/transparentize.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,6 @@ function transparentize(amount: number, color: string) {
return rgba(colorWithAlpha)
}

export default curry(transparentize)
// Don’t inline this variable into export because Rollup will remove the /*#__PURE__*/ comment
const curriedTransparentize = /*#__PURE__*/curry(transparentize) // eslint-disable-line spaced-comment
export default curriedTransparentize
4 changes: 3 additions & 1 deletion src/helpers/em.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ import pixelsto from '../internalHelpers/_pxto'
* }
*/

export default pixelsto('em')
// Don’t inline this variable into export because Rollup will remove the /*#__PURE__*/ comment
const em = /*#__PURE__*/pixelsto('em') // eslint-disable-line spaced-comment
export default em
5 changes: 4 additions & 1 deletion src/helpers/rem.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,7 @@ import pixelsto from '../internalHelpers/_pxto'
* 'height': '1rem'
* }
*/
export default pixelsto('rem')

// Don’t inline this variable into export because Rollup will remove the /*#__PURE__*/ comment
const rem = /*#__PURE__*/pixelsto('rem') // eslint-disable-line spaced-comment
export default rem
Loading