diff --git a/rescript/__tests__/test.js b/rescript/__tests__/test.js index eb4f31a..e197890 100644 --- a/rescript/__tests__/test.js +++ b/rescript/__tests__/test.js @@ -11,8 +11,11 @@ Jest.describe("", (function (param) { Jest.test("content", (function (param) { return Jest.Expect.toEqual("before:content-['']", Jest.Expect.expect(View.header10)); })); - return Jest.test("self & children selector", (function (param) { - return Jest.Expect.toEqual("peer-checked:[&>svg]:rotate-180", Jest.Expect.expect(View.header11)); + Jest.test("self & children selector", (function (param) { + return Jest.Expect.toEqual("peer-checked:[&>svg]:rotate-180", Jest.Expect.expect(View.header11)); + })); + return Jest.test("descendant combinator", (function (param) { + return Jest.Expect.toEqual("[&_a]:tw-mt-4", Jest.Expect.expect(View.header12)); })); })); diff --git a/rescript/__tests__/test.res b/rescript/__tests__/test.res index acecfb0..e042f3a 100644 --- a/rescript/__tests__/test.res +++ b/rescript/__tests__/test.res @@ -16,4 +16,9 @@ describe("", _ => { let header11 = View.header11 expect(header11) |> toEqual("peer-checked:[&>svg]:rotate-180") }) + + test("descendant combinator", _ => { + let header12 = View.header12 + expect(header12) |> toEqual("[&_a]:tw-mt-4") + }) }) diff --git a/rescript/css/tailwind.css b/rescript/css/tailwind.css index 348d315..8e1fd51 100644 --- a/rescript/css/tailwind.css +++ b/rescript/css/tailwind.css @@ -1533,3 +1533,7 @@ video { --tw-rotate: 180deg; transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); } + +.\[\&_a\]\:tw-mt-4 a { + margin-top: 4px +} diff --git a/rescript/src/View.js b/rescript/src/View.js index 8b0506f..589849c 100644 --- a/rescript/src/View.js +++ b/rescript/src/View.js @@ -24,6 +24,8 @@ var header10 = "before:content-['']"; var header11 = "peer-checked:[&>svg]:rotate-180"; +var header12 = "[&_a]:tw-mt-4"; + exports.header = header; exports.header2 = header2; exports.header3 = header3; @@ -35,4 +37,5 @@ exports.header8 = header8; exports.header9 = header9; exports.header10 = header10; exports.header11 = header11; +exports.header12 = header12; /* No side effect */ diff --git a/rescript/src/View.res b/rescript/src/View.res index af1135b..2e2aa32 100644 --- a/rescript/src/View.res +++ b/rescript/src/View.res @@ -9,3 +9,4 @@ let header8 = %twc("!pb-[270px]") let header9 = %twc("translate-x-2/4") let header10 = %twc("before:content-['']") let header11 = %twc("peer-checked:[&>svg]:rotate-180") +let header12 = %twc("[&_a]:tw-mt-4") diff --git a/src/lexer.mll b/src/lexer.mll index 8dcea78..82aed80 100644 --- a/src/lexer.mll +++ b/src/lexer.mll @@ -44,7 +44,7 @@ let pseudo_class = ':' let pseudo_element = "::" let l_attribute_selector = '[' let comma = ',' -let end_of_class = comma | pseudo_class | pseudo_element | l_attribute_selector | dot | newline | '>' | '{' +let end_of_class = comma | pseudo_class | pseudo_element | l_attribute_selector | dot | newline | '>' | '{' | white rule read = parse