Skip to content

Commit

Permalink
Merge pull request #52 from infinum/release/1.4.1
Browse files Browse the repository at this point in the history
1.4.1
  • Loading branch information
goranalkovic-infinum authored Oct 1, 2024
2 parents cbeb7e6 + 36acbf0 commit 8bec0ff
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.

This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a CHANGELOG](https://keepachangelog.com/).

## [1.4.1] - 2024-10-01
- `tailwindClasses` check will now work fine even if no `parts` are defined.

## [1.4.0] - 2024-09-30
- Introduced new, more flexible, and simpler to use `tailwindClasses` function. Replaces `getTwPart`, `getTwDynamicPart`, and `getTwClasses`.
- **Potentially breaking**: `twClassesEditor` is now appended to `twClasses`. If you need editor-only classes, you can now use the `twClassesEditorOnly` key. Editor-only classes replace `twClasses`, but will also have classes from `twClassesEditor`.
Expand Down Expand Up @@ -60,6 +63,7 @@ This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a

[Unreleased]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/master...HEAD

[1.4.1]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/1.4.0...1.4.1
[1.4.0]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/1.3.3...1.4.0
[1.3.3]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/1.3.2...1.3.3
[1.3.2]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/1.3.1...1.3.2
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": "@eightshift/frontend-libs-tailwind",
"version": "1.4.0",
"version": "1.4.1",
"description": "A framework for creating modern Gutenberg themes with styling provided by Tailwind CSS.",
"author": {
"name": "Eightshift team",
Expand Down
7 changes: 6 additions & 1 deletion scripts/editor/tailwindcss.js
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,12 @@ export const tailwindClasses = (part, attributes, manifest, ...custom) => {

let partName = 'base';

if (part?.length > 0 && typeof manifest.tailwind.parts[part] !== 'undefined' && allParts.includes(part)) {
if (
part !== 'base' &&
part?.length > 0 &&
typeof manifest?.tailwind?.parts?.[part] !== 'undefined' &&
allParts.includes(part)
) {
partName = part;
} else if (part !== 'base') {
throw new Error(`Part '${part}' is not defined in the manifest.`);
Expand Down

0 comments on commit 8bec0ff

Please sign in to comment.