File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change 1+ import { run } from './util/run'
2+
3+ let css = String . raw
4+
5+ test ( 'it detects classes in lit-html templates' , ( ) => {
6+ let config = {
7+ content : [
8+ {
9+ raw : `html\`<button class="bg-blue-400 hover:bg-blue-600 text-white font-bold py-2 px-4 rounded">\${data.title}</button>\`;` ,
10+ } ,
11+ ] ,
12+ corePlugins : { preflight : false } ,
13+ theme : { } ,
14+ plugins : [ ] ,
15+ }
16+
17+ return run ( '@tailwind utilities' , config ) . then ( ( result ) => {
18+ expect ( result . css ) . toMatchCss ( css `
19+ .rounded {
20+ border-radius : 0.25rem ;
21+ }
22+ .bg-blue-400 {
23+ --tw-bg-opacity : 1 ;
24+ background-color : rgb (96 165 250 / var (--tw-bg-opacity ));
25+ }
26+ .py-2 {
27+ padding-top : 0.5rem ;
28+ padding-bottom : 0.5rem ;
29+ }
30+ .px-4 {
31+ padding-left : 1rem ;
32+ padding-right : 1rem ;
33+ }
34+ .font-bold {
35+ font-weight : 700 ;
36+ }
37+ .text-white {
38+ --tw-text-opacity : 1 ;
39+ color : rgb (255 255 255 / var (--tw-text-opacity ));
40+ }
41+ .hover\:bg-blue-600 : hover {
42+ --tw-bg-opacity : 1 ;
43+ background-color : rgb (37 99 235 / var (--tw-bg-opacity ));
44+ }
45+ ` )
46+ } )
47+ } )
You can’t perform that action at this time.
0 commit comments