NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #2588 most downloaded on npm
A lightweight toolset for writing styles in Javascript.
Last release 3 years ago
no release in 18 months
Ships unpredictably
gaps range from 1 weeks to 1.8 years
Nearly every release is documented
notes for 44 of 44 stable releases
38 versions withdrawn
withdrawn after publishing
10 years old
94 releases · first in 2016
Remove annotate-pure-calls plugin to address incompatibility with later versions of rollup.
Remove unneeded pure function annotation plugin.
Remove unneeded pure function annotation plugin.
re: #642
One column per quarter.
Color Modules - addresses an issue with longer floats in color values. ( #610 - Thanks to @levymetal )
hls(a) - now properly parses percentages for opacity.
hls(a) - now properly parses percentages for opacity.rgb(a) - now properly parses percentages for opacity.color Modules - now support space-separated CSS color values for rgb(a) and hsl(a).
rgb - now accepts optional opacity value.hsl - now accepts optional opacity value.mix - remove unnecessary division by 1
Addressed several performance issues with regexes.
fluidRange - updated return value to use an array to address unclear object property typing error in flow.
scarf - removed scarf analytics package due to yarn incompatibilities and concerns over GDPR compliance.
We're super stoked to announce that polished.js v4.1.0 is officially out! It is available via your package manager of choice. This will be the final n
We're super stoked to announce that polished.js v4.1.0 is officially out! It is available via your package manager of choice. This will be the final non-patch release before v5.
npm install polished
yarn add polished
remToPx: We've introduced a new module to handle converting to rem values to px values. (#376)readableColor - Update docs and function signature to be clearer about the use of each parameter.
readableColor - Update docs and function signature to be clearer about the use of each parameter.transparentize - addressed an issue where we weren't handling cases where floats were greater than 2 decimals.
Updated @babel/runtime to address webpack v5 compatibility issue (Thanks @koba04 - #547 )
ellipsis: Fixes an issue where the webkit prefix was not properly applied with the multiline option. (Thanks @drakang4 - #546)
ellipsis: Fixes an issue where the webkit prefix was not properly applied with the multiline option. (Thanks @drakang4 - #546)`getValueAndUnit` Improvement: canceled deprecation of this and it now does what it says on the tin: returns the value and unit as an array. Typings a…
We're super stoked to announce that polished.js v4 is officially live! It is available via your package manager of choice:
npm install polished
yarn add polished
important: Helper for targeting rules in a style block generated by polished modules that need !important-level specificity. Can optionally specify a rule (or rules) to target specific rules.easeIn, easeOut, easeInOut: Will replace timingFunctions to allow for smaller modules for specific use cases instead of the larger, more general original implementation. (#402)between Improvement: now properly throws an error when mixed units are used for from/toSize and min/maxScreen. This also fixes the same bug in fluidRange. (#445)triangle Improvement: once again properly works with inherit by setting individual properties when inherit is used. (#430)stripUnit Improvement: now only does what it says on the tin: strips a unit from a provided CSS value. Typings are now appropriately set. (#451)getValueAndUnit Improvement: canceled deprecation of this and it now does what it says on the tin: returns the value and unit as an array. Typings are now appropriately set. (#451)ellipsis Improvement: now accepts a lines parameter to truncate multi-line text.timingFunctions: This will be deprecated in v5 in favor of easeIn, easeOut, easeInOut.fontFace: default is now to look for a local font of the same family-name before downloading. Can be turned
off by passing null to localFonts. Previously, if localFonts was not passed explcitily, it would never check.cssVar: deprecated passThrough in favor of being able to pass a defaultValue to better mimic CSS variable functionality.math: square root, factorial, and exponent have been moved to a separate symbol preset found at math/presets/exponentialSymbols/. This can be passed a second parameter to math to restore this functionality.readableColor: now defaults strict to true be default..prettierrc and .prettierignore to better control formatting in development environments.v5 will be focused completely on size, speed, and documentation. The biggest change will be the move to submodules. Polished has grown into a large library of helpers, mixins, and color functions. We find ourselves limiting functionality in order to keep bundle size down. By moving to submodules we will be able to expand functionality without worrying about the size of the library and provide small bundle impacts for projects that don't implement tree-shaking. As part of this we will finally be revamping the docs to provide dedicated sections for each module with better usage examples.
Nothing published for this version
We are releasing this as a beta to allow the community to test the changes, and make any last-minute accommodations for the breaking changes. In the p…
We're super stoked to announce that polished.js v4 is officially in beta! It is available via your package manager of choice:
npm install polished@next
yarn add polished@next
important: Helper for targeting rules in a style block generated by polished modules that need !important-level specificity. Can optionally specify a rule (or rules) to target specific rules.easeIn, easeOut, easeInOut: Will replace timingFunctions to allow for smaller modules for specific use cases instead of the larger, more general original implementation. (#402)between Improvement: now properly throws an error when mixed units are used for from/toSize and min/maxScreen. This also fixes the same bug in fluidRange. (#445)triangle Improvement: once again properly works with inherit by setting individual properties when inherit is used. (#430)stripUnit Improvement: now only does what it says on the tin: strips a unit from a provided CSS value. Typings are now appropriately set. (#451)getValueAndUnit Improvement: canceled deprecation of this and it now does what it says on the tin: returns the value and unit as an array. Typings are now appropriately set. (#451)ellipsis Improvement: now accepts a lines parameter to truncate multi-line text.timingFunctions: This will be deprecated in v5 in favor of easeIn, easeOut, easeInOut.fontFace: default is now to look for a local font of the same family-name before downloading. Can be turned
off by passing null to localFonts. Previously, if localFonts was not passed explcitily, it would never check.cssVar: deprecated passThrough in favor of being able to pass a defaultValue to better mimic CSS variable functionality.math: square root, factorial, and exponent have been moved to a separate symbol preset found at math/presets/exponentialSymbols/. This can be passed a second parameter to math to restore this functionality.readableColor: now defaults strict to true be default..prettierrc and .prettierignore to better control formatting in development environments.We are releasing this as a beta to allow the community to test the changes, and make any last-minute accommodations for the breaking changes. In the past, our biggest challenge with any new release has been typings. We are hoping this beta will allow those issues to be addressed before a full release. We expect this beta period to last around 2 weeks.
v5 will be focused completely on size, speed, and documentation. The biggest change will be the move to submodules. Polished has grown into a large library of helpers, mixins, and color functions. We find ourselves limiting functionality in order to keep bundle size down. By moving to submodules we will be able to expand functionality without worrying about the size of the library and provide small bundle impacts for projects that don't implement tree-shaking. As part of this we will finally be revamping the docs to provide dedicated sections for each module with better usage examples.
Addressed several performance issues with regexes.
scarf - removed scarf analytics package due to yarn incompatibilities and concerns over GDPR compliance.
We will continue to back-port critical bug and security fixes to this branch until the release of v5, at which point v4 will become the new LTS branch…
We're excited to release v3.7.0, polished's first Long Term Support (LTS) branch. We will continue to back-port critical bug and security fixes to this branch until the release of v5, at which point v4 will become the new LTS branch. This release also officially deprecates polished v2.x.x.
npm install polished@lts
yarn add polished@lts
between: now properly throws an error when mixed units are used for from/toSize and min/maxScreen. This also fixes the same bug in fluidRange. (#445)readableColor - Update docs and function signature to be clearer about the use of each parameter.transparentize - addressed an issue where we weren't handling cases where floats were greater than 2 decimals. (#548)triangle Improvement: once again properly works with inherit by setting individual properties when inherit is used. (#430).prettierrc and .prettierignore to better control formatting in development environments.linearGradient: Properly handles rgba values as the first color stop value and consistently formats all rgba calues in color stops.
linearGradient: Properly handles rgba values as the first color stop value and consistently formats all rgba calues in color stops.Security updates to build dependencies
master to main as default branchcssVar: Properly handles the exception where the document object is not available in non-browser environments (#518). This simply throws a proper erro
cssVar: Properly handles the exception where the document object is not available in non-browser environments (#518). This simply throws a proper error. It does not enable cssVar to work server-side.rgbToString: Fixes an issue where passing a rgba color with 0 alpha was incorrectly returning a hex value
rgbToString: Fixes an issue where passing a rgba color with 0 alpha was incorrectly returning a hex value (#515)normalize: Updates to normalize.css 8.0.1 to fix a regression to fix a regression with main not being set to display: block.
normalize: Updates to normalize.css 8.0.1 to fix a regression to fix a regression with main not being set to display: block.Removes esmodules: true from the esm build to fix an issue with ES5 support.
esmodules: true from the esm build to fix an issue with ES5 support.Remove extraneous jsnext:main bundle reference that was not pointing to an ES5 compatible build.
jsnext:main bundle reference that was not pointing to an ES5 compatible build.Build a commonjs bundle and make it the new main bundle.
commonjs bundle and make it the new main bundle.bugfixes: true.uglify with terser on minified standalone build.`cssVar`: fixed issue where CSS variables set my stylesheets were returning with a leading space and breaking other polished modules when passed the r
cssVar: fixed issue where CSS variables set my stylesheets were returning with a leading space and breaking other polished modules when passed the return value. (#493)`between`, `modularScale`, `triangle`: fixed issue where these modules were calling deprecated functionality in stripUnit and creating unnecessary con…
between, modularScale, triangle: fixed issue where these modules were calling deprecated functionality in stripUnit and creating unnecessary console noise (and subsequent performance problems).Deprecation: `stripUnit`: The optional unit return will be deprecated in v4. Previously, this was implemented to replace getValueAndUnit. However, we'…
We're super stoked to announce that polished.js v3.5.0 is officially out! It is available via your package manager of choice. This will be the final non-patch release before v4.
npm install polished
yarn add polished
cssVar: We've introduced a new module to handle fetching CSS Variable values. We chose to make this a standalone module as opposed to integrating it into all modules to keep module size down.readableColor: You can now turn on strict mode for custom provided return colors. This will ensure that they still meet AA contrasting standards. Otherwise, they will return black or white as normal. This mode is off by default in v3.5. (Thanks @mrmckeb).mix, tint, shade: Fixed a bug where mix was improperly weighting alpha channels to the second provided color instead of the first. This fix also impacts tint and shade which implement mix.stripUnit: The optional unit return will be deprecated in v4. Previously, this was implemented to replace getValueAndUnit. However, we've decided to keep the extra module and simplify stripUnitreadableColor: strict mode will be enabled by default in v4, it is currently disabled by default.position: fix typing for position to address typescript incompatability (63ab9a6), closes #475
flow: fix several errors with flow compatibility (5a8fd51) - Thanks @tobilen
hsl(a) - Fixed a bug preventing the use of decimal values.
hsl(a) - Fixed a bug preventing the use of decimal values.between (and therefore fluidRange) now supports unitless values for fromSize and toSize.
between (and therefore fluidRange) now supports unitless values for fromSize and toSize.Adds a color module (getContrast) for getting the contrast score between two colors.
getContrast) for getting the contrast score between two colors.meetsContrastGuidelines) for checking which contrast guidelines have been met between two colors.Thanks @souporserious!
(Color Modules) - Fixes a bug that would cause hue to be negative in some cases instead of rotating around the color wheel to a positive value. Thanks
hslToRgb: correct % for potential negative hue (5c306c8), closes #437
modularScale now supports all base values regardless of unit, including unitless values. (fixes #429)
modularScale now supports all base values regardless of unit, including unitless values. (fixes #429)parseToRGB is now case-insensitive (thanks @Andarist)modularScale: Remove rem/em restriction
triangle now supports intermediate directions (i.e. 'topLeft'). In most cases, it will now also return a smaller object than prior by combining colors
triangle now supports intermediate directions (i.e. 'topLeft'). In most cases, it will now also
return a smaller object than prior by combining colors into a single 'borderColor' line. (#399)triangle no longer relies on borderColorordirectionalProperty`, and therefore has a smaller bundle size.triangle where passing a unitless number to triangle defaulted to a pixel value. It will instead return the unitless value.fontFace now can provide optional format hints for each file src using the formatHint configuration option.
fontFace now can provide optional format hints for each file src using the formatHint configuration option. (#416)fontFace now supports a base64 encoded dataURI as the value for fontFilePath. Currently, only supports a single base64 value. Can also optionally use formatHint if fileFormats is passed. (#416)Fixes a bug with production error logging that was pointing to non-existent documentation.
adds sideEffects: false to the package.json
sideEffects: false to the package.jsondevDependenciesREADME.MD with note about moduleResolution: nodeReplaced negative lookbehind when matching seconds. This wasn't supported in all browsers.
Fixes an issue where math would not work in IE11 (due to lack of support for Object.values). Thanks @goldsziggy!
math would not work in IE11 (due to lack of support for Object.values). Thanks @goldsziggy!s, ms, deg, gd, rad, grad, & turn in math functions.Marked For Deprecation: `getValueAndUnit`: getValueAndUnit has been marked for deprecation and will be removed in v4. This in someways duplicated func…
We're super stoked to announce that polished.js v3 is officially out! It is available via your package manager of choice:
npm install polished
yarn add polished
linearGradient: We've introduced a new module to handle generating linear gradients. linearGradient accepts an array of color stops, and optional directions and fallback to generate a linear gradient with a single color background fallback.math: We've introduced a new module to handle doing calculations on CSS values. math accepts a formula as a string and currently supports addition, subtraction, multiplication, division, square root, powers, factorial, min, max, and modification of order of operations parentheses. This can also be extended to incorporate other mathematical functions.hslToColorString: Converts a HslColor or HslaColor object to a color string. (Thanks @sandiiarov)rgbToColorString: Converts a RgbColor or RgbaColor object to a color string. (Thanks @sandiiarov)error.md in production. This reduces the overall bundle size and will set us up for our much more thorough error system coming in v4.transparent keyword instead of erroring out. How each module handles this is slightly different, but you wll always get a valid color or transparent back when passing transparent to a color module.toColorString now properly use hslToColorString and rgbToColorString where appropriate. This speeds up color modules that were previously leveraging toColorString to convert colors between formats. (Thanks @sandiiarov)modularScale Improvement: modularScale now also accepts rem values for its base, where previously it only worked with em.readableColor Improvement: readableColor now offers the option to set the color(s) it returns for light or dark colors. Otherwise, it will work the way it always has, either returning white or black based on the passed colors luminosity.stripUnit Improvement: stripUnit now offers the option to return the value and unit as an array, replacing the functionality of getValueAndUnit. Without this option, it will continue to return just the stripped value.getValueAndUnit: getValueAndUnit has been marked for deprecation and will be removed in v4. This in someways duplicated functionality available in stripUnit. Instead of having two similar modules,stripUnit has been improved to optionally return the stripped unit as part of an array.selection: As indicated in the v2 release notes, selection has been deprecated. All css-in-js libraries handle this selector without additional prefixing from polished.placeholder: As indicated in the v2 release notes, placeholder has been deprecated. All css-in-js libraries handle this selector without additional prefixing from polished.As usual, we will be taking a bit of a break from major work for a couple months, but we are already planning out v4. This release will largely focus on library-wide impact, and likely won't include any new functionality. Here is the current state of the roadmap:
babel-plugin-polished - This plugin has been around since the early days of polished.js, but we've never taken official ownership of it. We will be pulling it forward in v4, updating it, and incorporating it into our testing and docs.getValueAndUnit - v4 will see this module fully deprecated.Nothing published for this version
Nothing published for this version
Nothing published for this version
We are releasing this as a beta to allow the community to test the changes, and make any last-minute accommodations for the breaking changes. In the p…
We're super stoked to announce that polished.js v3 is officially in beta! It is available via your package manager of choice:
npm install polished@next
yarn add polished@next
linearGradient: We've introduced a new module to handle generating linear gradients. linearGradient accepts an array of color stops, and optional directions and fallback to generate a linear gradient with a single color background fallback.math: We've introduced a new module to handle doing calculations on CSS values. math accepts a formula as a string and currently supports addition, subtraction, multiplication, division, square root, powers, factorial, min, max, and modification of order of operations parentheses. This can also be extended to incorporate other mathematical functions.hslToColorString: Converts a HslColor or HslaColor object to a color string. (Thanks @sandiiarov)rgbToColorString: Converts a RgbColor or RgbaColor object to a color string. (Thanks @sandiiarov)error.md in production. This reduces the overall bundle size and will set us up for our much more thorough error system coming in v4.transparent keyword instead of erroring out. How each module handles this is slightly different, but you wll always get a valid color or transparent back when passing transparent to a color module.toColorString now properly use hslToColorString and rgbToColorString where appropriate. This speeds up color modules that were previously leveraging toColorString to convert colors between formats. (Thanks @sandiiarov)modularScale Improvement: modularScale now also accepts rem values for its base, where previously it only worked with em.readableColor Improvement: readableColor now offers the option to set the color(s) it returns for light or dark colors. Otherwise, it will work the way it always has, either returning white or black based on the passed colors luminosity.stripUnit Improvement: stripUnit now offers the option to return the value and unit as an array, replacing the functionality of getValueAndUnit. Without this option, it will continue to return just the stripped value.getValueAndUnit: getValueAndUnit has been marked for deprecation and will be removed in v4. This in someways duplicated functionality available in stripUnit. Instead of having two similar modules,stripUnit has been improved to optionally return the stripped unit as part of an array.selection: As indicated in the v2 release notes, selection has been deprecated. All css-in-js libraries handle this selector without additional prefixing from polished.placeholder: As indicated in the v2 release notes, placeholder has been deprecated. All css-in-js libraries handle this selector without additional prefixing from polished.We are releasing this as a beta to allow the community to test the changes, and make any last-minute accommodations for the breaking changes. In the past, our biggest challenge with any new release has been typings. We are hoping this beta will allow those issues to be addressed before a full release. We expect this beta period to last around 2 weeks.
As usual, we will be taking a bit of a break from major work for a couple months, but we are already planning out v4. This release will largely focus on library-wide impact, and likely won't include any new functionality. Here is the current state of the roadmap:
babel-plugin-polished - This plugin has been around since the early days of polished.js, but we've never taken official ownership of it. We will be pulling it forward in v4, updating it, and incorporating it into our testing and docs.getValueAndUnit - v4 will see this module fully deprecated.Nothing published for this version
Nothing published for this version
types/deps: Update types and deps
## 2.3.2 (2019-01-09) ### Bug Fixes * Flow: add required annotations
normalize: Fix hyphenated rule in normalize
triangle: add ability to use float values for triangle width/height
shade: function should mix a color WITH black
Color modules now support 4-Digit Hex code shorthands (#368).
ellipsis: Remove inline-flex from ellipsis. (9d8300e), closes #360
Your coding agent can read these notes before it upgrades. Set up the MCP server →