-
-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix CSS escaping + add tests for Tailwind CSS
- Loading branch information
Showing
7 changed files
with
80 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
packages/build/test/build-async/fixtures/14-tailwind-css/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"figma-plugin": { | ||
"id": "42", | ||
"name": "a", | ||
"main": "src/main.ts", | ||
"ui": "src/ui.ts" | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
packages/build/test/build-async/fixtures/14-tailwind-css/src/main.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { showUI } from '@create-figma-plugin/utilities' | ||
|
||
export default function () { | ||
const options = { height: 120, width: 240 } | ||
const data = { greeting: 'Hello, World!' } | ||
showUI(options, data) | ||
} |
13 changes: 13 additions & 0 deletions
13
packages/build/test/build-async/fixtures/14-tailwind-css/src/styles.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.\!top-\[117px\] { | ||
top: 117px !important; | ||
} | ||
|
||
.before\:content-\[\'foo\'\]::before { | ||
--tw-content: 'foo'; | ||
content: var(--tw-content); | ||
} | ||
|
||
.hover\:bg-\[\#bada55\]:hover { | ||
--tw-bg-opacity: 1; | ||
background-color: rgb(186 218 85 / var(--tw-bg-opacity)); | ||
} |
5 changes: 5 additions & 0 deletions
5
packages/build/test/build-async/fixtures/14-tailwind-css/src/ui.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import '!./styles.css' | ||
|
||
export default function (rootNode: HTMLElement, data: { greeting: string }) { | ||
rootNode.innerHTML = `<p class="!top-[117px] hover:bg-[#bada55] before:content-['foo']">${data.greeting}</p>` | ||
} |
7 changes: 7 additions & 0 deletions
7
packages/build/test/build-async/fixtures/14-tailwind-css/tsconfig.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"extends": "@create-figma-plugin/tsconfig", | ||
"compilerOptions": { | ||
"typeRoots": ["node_modules/@figma"] | ||
}, | ||
"include": ["src/**/*.ts"] | ||
} |