Skip to content

Commit

Permalink
V4.0.0 - Breaking Change : Fix long-awaited typo issue in config for …
Browse files Browse the repository at this point in the history
…Spacing - "arbitraries" instead of "arbritraries"
  • Loading branch information
mrdoinel committed Feb 21, 2024
1 parent 849a42c commit 7245bed
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 12 deletions.
12 changes: 10 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.14.0] - 2024-02-14
## [4.0.0] - 2024-02-21

### Changed

- Fix typo in frontend config, this is a **breaking change** as this require updating config file when upgrading to this version :

For Spacing now use "arbitraries" instead of "arbritraries"

## [3.14.0] - 2024-02-18

### Changed

Expand All @@ -15,7 +23,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Fixed

- Fix usage of a global Prefix with the plugins
For example by setting up `a17` as prefix, the generated classes will look like this :
For example by setting up `a17-` as prefix, the generated classes will look like this :
```
.container => .a17-container
.f-heading-01 => .a17-f-heading-01
Expand Down
4 changes: 2 additions & 2 deletions docs/SpacingTokens.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ <h3 id="defined">Scale defined:</h3>
spacing: SpacingTokens({
scaler: 4,
max: 200,
arbritraries: {
arbitraries: {
"400": "400px"
}
})
Expand Down Expand Up @@ -203,7 +203,7 @@ <h2 id="demo">Demo</h2>
class="code-example-code"
><code class="language-javascript">SpacingTokens({
scaler: 4,
arbritraries: {
arbitraries: {
"400": "400px"
}
})</code></pre>
Expand Down
2 changes: 1 addition & 1 deletion docs/frontend.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"spacing": {
"tokens": {
"scaler": 4,
"arbritraries": {
"arbitraries": {
"400": "400px",
"600": "600px"
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@area17/a17-tailwind-plugins",
"version": "3.14.0",
"version": "4.0.0",
"author": "A17 <[email protected]> (https://area17.com/)",
"description": "A collection of Tailwind plugins to help build responsive design systems in collaboration with A17 design and development build methodologies",
"main": "index.js",
Expand Down
12 changes: 6 additions & 6 deletions src/SpacingTokens/index.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
module.exports = function (spacingTokens) {
let scaler = spacingTokens && spacingTokens.scaler ? spacingTokens.scaler : 5;
let max = spacingTokens && spacingTokens.max ? spacingTokens.max : 100;
let arbritraries = {};
let arbitraries = {};
let input = spacingTokens || {};
const output = {};

// make arbitrary values from 0 - 10px
for (let n = 0; n <= 10; n++) {
arbritraries[`${n}`] = `${n}px`;
arbitraries[`${n}`] = `${n}px`;
}

// check to see if there are some specified spacing tokens, or see if some settings are specified
if (
!spacingTokens ||
spacingTokens.scaler ||
spacingTokens.max ||
spacingTokens.arbritraries
spacingTokens.arbitraries
) {
if (spacingTokens && spacingTokens.arbritraries) {
if (spacingTokens && spacingTokens.arbitraries) {
// merge arbitrary values if some set
input = Object.assign(arbritraries, spacingTokens.arbritraries);
input = Object.assign(arbitraries, spacingTokens.arbitraries);
} else {
// else lets roll with just the 0 - 10px arbitrary values
input = arbritraries;
input = arbitraries;
}

// generate values for the scaler times table
Expand Down

0 comments on commit 7245bed

Please sign in to comment.