adaptable-text
Advanced tools
Comparing version 0.1.2 to 2.0.1
{ | ||
"name": "adaptable-text", | ||
"title": "Adaptable Text", | ||
"version": "0.1.2", | ||
"description": "Adapt font size to fit text in element (WIP)", | ||
"version": "2.0.1", | ||
"description": "Adapt font size to a specified width.", | ||
"main": "lib/adaptable-text.js", | ||
"jsnext:main": "lib/adaptable-text.module.js", | ||
"module": "lib/adaptable-text.module.js", | ||
"license": "MIT", | ||
"repository": "https://github.com/dmnsgn/adaptable-text", | ||
"author": { | ||
"name": "Damien Seguin", | ||
"url": "https://dmnsgn.me" | ||
}, | ||
"engines": { | ||
"node": ">=0.10.0" | ||
}, | ||
"keywords": [ | ||
"responsive", | ||
"text", | ||
"adaptable", | ||
"javascript" | ||
"fontsize" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/dmnsgn/adaptable-text.git" | ||
"scripts": { | ||
"dev": "rollup -c -w -m inline", | ||
"clean": "rm -rf lib", | ||
"build": "rollup -c", | ||
"test": "budo test/index.js --open --live", | ||
"prepublishOnly": "npm run build" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/dmnsgn/adaptable-text/issues" | ||
}, | ||
"author": { | ||
"name": "Damien Seguin", | ||
"url": "https://github.com/dmnsgn" | ||
}, | ||
"license": "MIT", | ||
"devDependencies": { | ||
"grunt": "~0.4.5", | ||
"grunt-cli": "~0.1.13", | ||
"grunt-contrib-coffee": "^0.12.0", | ||
"grunt-contrib-concat": "^0.5.1", | ||
"grunt-contrib-jshint": "^0.11.0", | ||
"grunt-contrib-uglify": "^0.8.0", | ||
"grunt-contrib-watch": "^0.6.1" | ||
"babel-core": "^6.25.0", | ||
"babel-plugin-external-helpers": "^6.22.0", | ||
"babel-plugin-transform-class-properties": "^6.24.1", | ||
"babel-plugin-transform-runtime": "^6.23.0", | ||
"babel-polyfill": "^6.26.0", | ||
"babel-preset-latest": "^6.24.1", | ||
"budo": "^10.0.4", | ||
"prettier": "^1.5.3", | ||
"regenerator-runtime": "^0.10.5", | ||
"rollup": "^0.43.1", | ||
"rollup-plugin-babel": "^3.0.1", | ||
"rollup-plugin-node-resolve": "^3.0.0", | ||
"rollup-watch": "^4.3.1", | ||
"uglify-js": "^3.0.23" | ||
}, | ||
"scripts": { | ||
"test": "grunt travis --verbose" | ||
"dependencies": { | ||
"clamp": "^1.0.1" | ||
} | ||
} |
@@ -1,8 +0,66 @@ | ||
Adaptable Text (WIP) | ||
========================= | ||
# adaptable-text | ||
> Adapt font size to fit text in element (WIP) | ||
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier) | ||
## Licence | ||
MIT | ||
> Adapt font size to a specified width. | ||
## Install | ||
``` | ||
$ npm install --save adaptable-text | ||
``` | ||
## Usage | ||
```js | ||
const textToAdapt = new AdaptableText(document.querySelector(".textToAdapt"), { | ||
step: 0.1, | ||
minFontSize: 10, | ||
width: null | ||
}); | ||
textToAdapt.init(); | ||
// Adapt | ||
const adapt = () => { | ||
textToAdapt.setWidth(); | ||
textToAdapt.adapt(); | ||
}; | ||
// Listen for a resize event | ||
window.addEventListener("resize", adapt); | ||
// Kick off | ||
requestIdleCallback(() => { | ||
adapt(); | ||
}); | ||
``` | ||
|Key|Description | ||
|:---------|:---------| | ||
|**step**|The step used by the generator to calculate the width of the element| | ||
|**minFontSize**|A minimum font size for the element (max would be the size defined in a stylesheet retrieved by `window.getComputedStyle(this.element)`)| | ||
|**width**|A maximum widht for the container.| | ||
## Scripts | ||
### Dev | ||
```bash | ||
npm run dev | ||
``` | ||
### Test | ||
```bash | ||
npm run test | ||
``` | ||
### Build | ||
```bash | ||
npm run build | ||
``` | ||
## License | ||
MIT © [Damien Seguin](https://github.com/dmnsgn) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
21133
13
503
1
67
1
14
1
1
1
+ Addedclamp@^1.0.1
+ Addedclamp@1.0.1(transitive)