Skip to content

Commit

Permalink
docs(math): Update math docs.
Browse files Browse the repository at this point in the history
Update match docs to add division. Also added warning about accepting user inputted values.
  • Loading branch information
bhough committed Feb 2, 2019
1 parent 57266c3 commit 5dc25c0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"main": "lib/index.js",
"module": "dist/polished.es.js",
"types": "lib/index.d.ts",
"version": "3.0.0-beta.0",
"version": "3.0.0-beta.1",
"scripts": {
"build": "yarn build:lib && yarn build:dist && yarn build:flow && yarn build:docs && yarn build:typescript",
"prebuild:lib": "shx rm -rf lib/*",
Expand Down
4 changes: 3 additions & 1 deletion src/math/math.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,11 @@ function calculate(expression: string, additionalSymbols?: Object): number {
}

/**
* Helper for doing math with CSS Units. Accepts a formula as a string. All values in the formula must have the same unit (or be unitless). Supports complex formulas utliziing addition, subtraction, multiplication, squareroot, power, factorial, min, max, as well as parentheses for order of operation.
* Helper for doing math with CSS Units. Accepts a formula as a string. All values in the formula must have the same unit (or be unitless). Supports complex formulas utliziing addition, subtraction, multiplication, division, square root, powers, factorial, min, max, as well as parentheses for order of operation.
*
*In cases where you need to do calculations with mixed units where one unit is a [relative length unit](https://developer.mozilla.org/en-US/docs/Web/CSS/length#Relative_length_units), you will want to use [CSS Calc](https://developer.mozilla.org/en-US/docs/Web/CSS/calc).
*
* *warning* While we've done everything possible to ensure math safely evalutes formulas expressed as strings, you should always use extreme caution when passing `math` user provided values.
* @example
* // Styles as object usage
* const styles = {
Expand Down

0 comments on commit 5dc25c0

Please sign in to comment.