Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nesting for selectors (and pseudo) in native #483

Merged
merged 16 commits into from
Jul 4, 2024

Conversation

davesnx
Copy link
Owner

@davesnx davesnx commented Jun 28, 2024

Resolves all issues with nesting media-queries and selectors when using emotion_native defined here: #359

Copy link

vercel bot commented Jun 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
styled-ppx ⬜️ Ignored (Inspect) Visit Preview Jul 4, 2024 1:07pm

Copy link

github-actions bot commented Jun 28, 2024

New nightly version has been published to the NPM registry: @davesnx/styled-ppx@0.56.1-f00a3c1.0.
Install it with npm install @davesnx/styled-ppx@nightly or npm install @davesnx/styled-ppx@0.56.1-f00a3c1.0.

@davesnx davesnx changed the title Add hack on rendering for pesudo-selectors in native Fix nesting for selectors (and pseudo) Jul 2, 2024
@davesnx davesnx changed the title Fix nesting for selectors (and pseudo) Fix nesting for selectors (and pseudo) in native Jul 2, 2024
@davesnx davesnx force-pushed the Add-hack-for-nonspaced-selectors branch from 5eeceee to 96a96b1 Compare July 2, 2024 18:35
@@ -107,6 +107,7 @@ let render_declarations (rules : rule list) =
let is_at_rule selector = String.contains selector '@'
let is_a_pseudo_selector selector = String.starts_with ~prefix:":" selector
let starts_with_at selector = String.starts_with ~prefix:"@" selector
let starts_with_double_dot selector = String.starts_with ~prefix:":" selector
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dumb question: what is the difference between starts_with_double_dot and is_a_pseudo_selector

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm removing support for Css in monorepo and will eventually remove it from styled-ppx. That's why Css isn't at pair with CssJs (where some bugfix got fixed only in CssJs)

@davesnx davesnx merged commit 8e8c7ea into main Jul 4, 2024
6 checks passed
@davesnx davesnx deleted the Add-hack-for-nonspaced-selectors branch July 4, 2024 13:15
davesnx added a commit to davesnx/opam-repository that referenced this pull request Jul 4, 2024
CHANGES:

## 0.57.1
- Remove public_name from alcotest_extra davesnx/styled-ppx#484 (@davesnx)
- Fix nesting for selectors (and pseudo) in native davesnx/styled-ppx#483 (@davesnx)

## 0.57.0

- Improvement for locations in both code-gen and error reporting by @davesnx in davesnx/styled-ppx#456
- Support css min and max functions by @lubegasimon in davesnx/styled-ppx#411
- Update docs by @zakybilfagih in davesnx/styled-ppx#457
- update server-reason-react pin to main branch by @zakybilfagih in davesnx/styled-ppx#460
- Native support for styled.{{tag}} by @zakybilfagih in davesnx/styled-ppx#461
- Fix linear-gradient and radial-gradient  by @davesnx in davesnx/styled-ppx#464
- Add getting started docs by @zakybilfagih in davesnx/styled-ppx#459
- escape curly on remote markdown content by @zakybilfagih in davesnx/styled-ppx#466
- Add Melange and native instructions by @davesnx in davesnx/styled-ppx#465
- Global styles for native server on emotion by @pedrobslisboa in davesnx/styled-ppx#468
- Style HTML tag by @pedrobslisboa in davesnx/styled-ppx#467
- [emotion native] Fix nested pseudoelements by @davesnx in davesnx/styled-ppx#470
- Transform with variable handle unsafe interpolation by @zakybilfagih in davesnx/styled-ppx#471
- Add depext for @emotion/css >= 11.0.0 by @feihong in davesnx/styled-ppx#473
- Add support for transition by @zakybilfagih in davesnx/styled-ppx#472
- Fix animation codegen by @zakybilfagih in davesnx/styled-ppx#475
- Fix error line number coming from parser by @zakybilfagih in davesnx/styled-ppx#478
- Polish emotion-native by @davesnx in davesnx/styled-ppx#481
- Rename `render_style_tag` to `get_stylesheet` (@davesnx)
- Docs: Explain show server rendered stylesheets work natively by @ManasJayanth in davesnx/styled-ppx#480

## 0.56.0

- Improvement for locations in both code-gen and error reporting (davesnx/styled-ppx#456) by @davesnx
- Support css min and max functions (davesnx/styled-ppx#411) by @lubegasimon
- Update docs (davesnx/styled-ppx#457) by @zakybilfagih
- Native support for styled.{{tag}} (davesnx/styled-ppx#461) by @zakybilfagih
- background-clip: text support by @davesnx
- Fix linear-gradient and radial-gradient (davesnx/styled-ppx#464) by @davesnx
- Rename emotion-hash into murmur2 and remove public testing cli by @davesnx
- Use server-reason-react from opam by @davesnx
davesnx added a commit to davesnx/opam-repository that referenced this pull request Jul 18, 2024
CHANGES:

## 0.59.0
- [BREAKING] Change entry point module `CSS` (from `CssJs`) on `styled-ppx.melange`, `styled-ppx.native` and `styled-ppx.rescript` (davesnx/styled-ppx#490) (@davesnx)
- [FEATURE] Add support and interpolation for `zoom`, `will-change` and `user-select` properties (davesnx/styled-ppx#489) (@davesnx)
- [FEATURE] Support content with interpolation davesnx/styled-ppx#494 (@davesnx)
- [FEATURE] Support define CSS variables in global and use CSS variables in properties davesnx/styled-ppx#492 (@davesnx)
- [FEATURE] Support overflow with 2 values
- [FEATURE] Make animation-name abstract (@davesnx)
- [FIX] Add 100 unsupported properties, which will render properly (davesnx/styled-ppx#489) (@davesnx)
- [FIX] Inline all CSS.Var and CSS.Cascading in properties (davesnx/styled-ppx#495) (@davesnx)
- [FIX] Color with support for rgba/hsla and others with calc/min and max (davesnx/styled-ppx#495) (@davesnx)
- [FIX] Warning of kebab-case on emotion client side (davesnx/styled-ppx#493) (@davesnx)

## 0.58.1
- [BREAKING] FontFamilyName.t is now a string (@davesnx)
- [FIX] Make unsafe calls from "Cascading" be camelCase to avoid emotion's warning davesnx/styled-ppx#488 (@davesnx)
- [FIX] Keep classname when ampersand is at the end of the selector (@davesnx)
- [FIX] Fix fontFace in both melange and native (@davesnx)

## 0.58.0
- [FEATURE] Initial @container support davesnx/styled-ppx#476 (@zakybilfagih)
- [FIX] Make selector nested maintain other selectors davesnx/styled-ppx#486 (@davesnx)
- [BREAKING] Remove `Css` module, `styled_label` and friends davesnx/styled-ppx#487 (@davesnx)
- [BREAKING] Merge styled-ppx.css and styled-ppx.emotion into styled-ppx.melange davesnx/styled-ppx#487 (@davesnx)
- [BREAKING] Merge styled-ppx.css-native and styled-ppx.emotion-native into styled-ppx.native davesnx/styled-ppx#487 (@davesnx)
- [BREAKING] Merge styled-ppx.css-native and styled-ppx.emotion-native into styled-ppx.native davesnx/styled-ppx#487 (@davesnx)
- [BREAKING] Remove PseudoClass and PseudoClassParam davesnx/styled-ppx#487 (@davesnx)
- Remove functor from Css_Js_Core davesnx/styled-ppx#487 (@davesnx)
- Remove melange.js and melange.belt from styled-ppx.melange davesnx/styled-ppx#487 (@davesnx)
- Remove server-reason-react.js and server-reason-react.belt from styled-ppx.native davesnx/styled-ppx#487 (@davesnx)

## 0.57.1
- Remove public_name from alcotest_extra davesnx/styled-ppx#484 (@davesnx)
- Fix nesting for selectors (and pseudo) in native davesnx/styled-ppx#483 (@davesnx)

## 0.57.0

- Improvement for locations in both code-gen and error reporting by @davesnx in davesnx/styled-ppx#456
- Support css min and max functions by @lubegasimon in davesnx/styled-ppx#411
- Update docs by @zakybilfagih in davesnx/styled-ppx#457
- update server-reason-react pin to main branch by @zakybilfagih in davesnx/styled-ppx#460
- Native support for styled.{{tag}} by @zakybilfagih in davesnx/styled-ppx#461
- Fix linear-gradient and radial-gradient  by @davesnx in davesnx/styled-ppx#464
- Add getting started docs by @zakybilfagih in davesnx/styled-ppx#459
- escape curly on remote markdown content by @zakybilfagih in davesnx/styled-ppx#466
- Add Melange and native instructions by @davesnx in davesnx/styled-ppx#465
- Global styles for native server on emotion by @pedrobslisboa in davesnx/styled-ppx#468
- Style HTML tag by @pedrobslisboa in davesnx/styled-ppx#467
- [emotion native] Fix nested pseudoelements by @davesnx in davesnx/styled-ppx#470
- Transform with variable handle unsafe interpolation by @zakybilfagih in davesnx/styled-ppx#471
- Add depext for @emotion/css >= 11.0.0 by @feihong in davesnx/styled-ppx#473
- Add support for transition by @zakybilfagih in davesnx/styled-ppx#472
- Fix animation codegen by @zakybilfagih in davesnx/styled-ppx#475
- Fix error line number coming from parser by @zakybilfagih in davesnx/styled-ppx#478
- Polish emotion-native by @davesnx in davesnx/styled-ppx#481
- Rename `render_style_tag` to `get_stylesheet` (@davesnx)
- Docs: Explain show server rendered stylesheets work natively by @ManasJayanth in davesnx/styled-ppx#480

## 0.56.0

- Improvement for locations in both code-gen and error reporting (davesnx/styled-ppx#456) by @davesnx
- Support css min and max functions (davesnx/styled-ppx#411) by @lubegasimon
- Update docs (davesnx/styled-ppx#457) by @zakybilfagih
- Native support for styled.{{tag}} (davesnx/styled-ppx#461) by @zakybilfagih
- background-clip: text support by @davesnx
- Fix linear-gradient and radial-gradient (davesnx/styled-ppx#464) by @davesnx
- Rename emotion-hash into murmur2 and remove public testing cli by @davesnx
- Use server-reason-react from opam by @davesnx
davesnx added a commit to davesnx/opam-repository that referenced this pull request Jul 23, 2024
CHANGES:

## 0.59.0
- [BREAKING] Change entry point module `CSS` (from `CssJs`) on `styled-ppx.melange`, `styled-ppx.native` and `styled-ppx.rescript` (davesnx/styled-ppx#490) (@davesnx)
- [FEATURE] Add support and interpolation for `zoom`, `will-change` and `user-select` properties (davesnx/styled-ppx#489) (@davesnx)
- [FEATURE] Support content with interpolation davesnx/styled-ppx#494 (@davesnx)
- [FEATURE] Support define CSS variables in global and use CSS variables in properties davesnx/styled-ppx#492 (@davesnx)
- [FEATURE] Support overflow with 2 values
- [FEATURE] Make animation-name abstract (@davesnx)
- [FIX] Add 100 unsupported properties, which will render properly (davesnx/styled-ppx#489) (@davesnx)
- [FIX] Inline all CSS.Var and CSS.Cascading in properties (davesnx/styled-ppx#495) (@davesnx)
- [FIX] Color with support for rgba/hsla and others with calc/min and max (davesnx/styled-ppx#495) (@davesnx)
- [FIX] Warning of kebab-case on emotion client side (davesnx/styled-ppx#493) (@davesnx)

## 0.58.1
- [BREAKING] FontFamilyName.t is now a string (@davesnx)
- [FIX] Make unsafe calls from "Cascading" be camelCase to avoid emotion's warning davesnx/styled-ppx#488 (@davesnx)
- [FIX] Keep classname when ampersand is at the end of the selector (@davesnx)
- [FIX] Fix fontFace in both melange and native (@davesnx)

## 0.58.0
- [FEATURE] Initial @container support davesnx/styled-ppx#476 (@zakybilfagih)
- [FIX] Make selector nested maintain other selectors davesnx/styled-ppx#486 (@davesnx)
- [BREAKING] Remove `Css` module, `styled_label` and friends davesnx/styled-ppx#487 (@davesnx)
- [BREAKING] Merge styled-ppx.css and styled-ppx.emotion into styled-ppx.melange davesnx/styled-ppx#487 (@davesnx)
- [BREAKING] Merge styled-ppx.css-native and styled-ppx.emotion-native into styled-ppx.native davesnx/styled-ppx#487 (@davesnx)
- [BREAKING] Merge styled-ppx.css-native and styled-ppx.emotion-native into styled-ppx.native davesnx/styled-ppx#487 (@davesnx)
- [BREAKING] Remove PseudoClass and PseudoClassParam davesnx/styled-ppx#487 (@davesnx)
- Remove functor from Css_Js_Core davesnx/styled-ppx#487 (@davesnx)
- Remove melange.js and melange.belt from styled-ppx.melange davesnx/styled-ppx#487 (@davesnx)
- Remove server-reason-react.js and server-reason-react.belt from styled-ppx.native davesnx/styled-ppx#487 (@davesnx)

## 0.57.1
- Remove public_name from alcotest_extra davesnx/styled-ppx#484 (@davesnx)
- Fix nesting for selectors (and pseudo) in native davesnx/styled-ppx#483 (@davesnx)

## 0.57.0

- Improvement for locations in both code-gen and error reporting by @davesnx in davesnx/styled-ppx#456
- Support css min and max functions by @lubegasimon in davesnx/styled-ppx#411
- Update docs by @zakybilfagih in davesnx/styled-ppx#457
- update server-reason-react pin to main branch by @zakybilfagih in davesnx/styled-ppx#460
- Native support for styled.{{tag}} by @zakybilfagih in davesnx/styled-ppx#461
- Fix linear-gradient and radial-gradient  by @davesnx in davesnx/styled-ppx#464
- Add getting started docs by @zakybilfagih in davesnx/styled-ppx#459
- escape curly on remote markdown content by @zakybilfagih in davesnx/styled-ppx#466
- Add Melange and native instructions by @davesnx in davesnx/styled-ppx#465
- Global styles for native server on emotion by @pedrobslisboa in davesnx/styled-ppx#468
- Style HTML tag by @pedrobslisboa in davesnx/styled-ppx#467
- [emotion native] Fix nested pseudoelements by @davesnx in davesnx/styled-ppx#470
- Transform with variable handle unsafe interpolation by @zakybilfagih in davesnx/styled-ppx#471
- Add depext for @emotion/css >= 11.0.0 by @feihong in davesnx/styled-ppx#473
- Add support for transition by @zakybilfagih in davesnx/styled-ppx#472
- Fix animation codegen by @zakybilfagih in davesnx/styled-ppx#475
- Fix error line number coming from parser by @zakybilfagih in davesnx/styled-ppx#478
- Polish emotion-native by @davesnx in davesnx/styled-ppx#481
- Rename `render_style_tag` to `get_stylesheet` (@davesnx)
- Docs: Explain show server rendered stylesheets work natively by @ManasJayanth in davesnx/styled-ppx#480

## 0.56.0

- Improvement for locations in both code-gen and error reporting (davesnx/styled-ppx#456) by @davesnx
- Support css min and max functions (davesnx/styled-ppx#411) by @lubegasimon
- Update docs (davesnx/styled-ppx#457) by @zakybilfagih
- Native support for styled.{{tag}} (davesnx/styled-ppx#461) by @zakybilfagih
- background-clip: text support by @davesnx
- Fix linear-gradient and radial-gradient (davesnx/styled-ppx#464) by @davesnx
- Rename emotion-hash into murmur2 and remove public testing cli by @davesnx
- Use server-reason-react from opam by @davesnx
avsm pushed a commit to avsm/opam-repository that referenced this pull request Sep 5, 2024
CHANGES:

## 0.59.0
- [BREAKING] Change entry point module `CSS` (from `CssJs`) on `styled-ppx.melange`, `styled-ppx.native` and `styled-ppx.rescript` (davesnx/styled-ppx#490) (@davesnx)
- [FEATURE] Add support and interpolation for `zoom`, `will-change` and `user-select` properties (davesnx/styled-ppx#489) (@davesnx)
- [FEATURE] Support content with interpolation davesnx/styled-ppx#494 (@davesnx)
- [FEATURE] Support define CSS variables in global and use CSS variables in properties davesnx/styled-ppx#492 (@davesnx)
- [FEATURE] Support overflow with 2 values
- [FEATURE] Make animation-name abstract (@davesnx)
- [FIX] Add 100 unsupported properties, which will render properly (davesnx/styled-ppx#489) (@davesnx)
- [FIX] Inline all CSS.Var and CSS.Cascading in properties (davesnx/styled-ppx#495) (@davesnx)
- [FIX] Color with support for rgba/hsla and others with calc/min and max (davesnx/styled-ppx#495) (@davesnx)
- [FIX] Warning of kebab-case on emotion client side (davesnx/styled-ppx#493) (@davesnx)

## 0.58.1
- [BREAKING] FontFamilyName.t is now a string (@davesnx)
- [FIX] Make unsafe calls from "Cascading" be camelCase to avoid emotion's warning davesnx/styled-ppx#488 (@davesnx)
- [FIX] Keep classname when ampersand is at the end of the selector (@davesnx)
- [FIX] Fix fontFace in both melange and native (@davesnx)

## 0.58.0
- [FEATURE] Initial @container support davesnx/styled-ppx#476 (@zakybilfagih)
- [FIX] Make selector nested maintain other selectors davesnx/styled-ppx#486 (@davesnx)
- [BREAKING] Remove `Css` module, `styled_label` and friends davesnx/styled-ppx#487 (@davesnx)
- [BREAKING] Merge styled-ppx.css and styled-ppx.emotion into styled-ppx.melange davesnx/styled-ppx#487 (@davesnx)
- [BREAKING] Merge styled-ppx.css-native and styled-ppx.emotion-native into styled-ppx.native davesnx/styled-ppx#487 (@davesnx)
- [BREAKING] Merge styled-ppx.css-native and styled-ppx.emotion-native into styled-ppx.native davesnx/styled-ppx#487 (@davesnx)
- [BREAKING] Remove PseudoClass and PseudoClassParam davesnx/styled-ppx#487 (@davesnx)
- Remove functor from Css_Js_Core davesnx/styled-ppx#487 (@davesnx)
- Remove melange.js and melange.belt from styled-ppx.melange davesnx/styled-ppx#487 (@davesnx)
- Remove server-reason-react.js and server-reason-react.belt from styled-ppx.native davesnx/styled-ppx#487 (@davesnx)

## 0.57.1
- Remove public_name from alcotest_extra davesnx/styled-ppx#484 (@davesnx)
- Fix nesting for selectors (and pseudo) in native davesnx/styled-ppx#483 (@davesnx)

## 0.57.0

- Improvement for locations in both code-gen and error reporting by @davesnx in davesnx/styled-ppx#456
- Support css min and max functions by @lubegasimon in davesnx/styled-ppx#411
- Update docs by @zakybilfagih in davesnx/styled-ppx#457
- update server-reason-react pin to main branch by @zakybilfagih in davesnx/styled-ppx#460
- Native support for styled.{{tag}} by @zakybilfagih in davesnx/styled-ppx#461
- Fix linear-gradient and radial-gradient  by @davesnx in davesnx/styled-ppx#464
- Add getting started docs by @zakybilfagih in davesnx/styled-ppx#459
- escape curly on remote markdown content by @zakybilfagih in davesnx/styled-ppx#466
- Add Melange and native instructions by @davesnx in davesnx/styled-ppx#465
- Global styles for native server on emotion by @pedrobslisboa in davesnx/styled-ppx#468
- Style HTML tag by @pedrobslisboa in davesnx/styled-ppx#467
- [emotion native] Fix nested pseudoelements by @davesnx in davesnx/styled-ppx#470
- Transform with variable handle unsafe interpolation by @zakybilfagih in davesnx/styled-ppx#471
- Add depext for @emotion/css >= 11.0.0 by @feihong in davesnx/styled-ppx#473
- Add support for transition by @zakybilfagih in davesnx/styled-ppx#472
- Fix animation codegen by @zakybilfagih in davesnx/styled-ppx#475
- Fix error line number coming from parser by @zakybilfagih in davesnx/styled-ppx#478
- Polish emotion-native by @davesnx in davesnx/styled-ppx#481
- Rename `render_style_tag` to `get_stylesheet` (@davesnx)
- Docs: Explain show server rendered stylesheets work natively by @ManasJayanth in davesnx/styled-ppx#480

## 0.56.0

- Improvement for locations in both code-gen and error reporting (davesnx/styled-ppx#456) by @davesnx
- Support css min and max functions (davesnx/styled-ppx#411) by @lubegasimon
- Update docs (davesnx/styled-ppx#457) by @zakybilfagih
- Native support for styled.{{tag}} (davesnx/styled-ppx#461) by @zakybilfagih
- background-clip: text support by @davesnx
- Fix linear-gradient and radial-gradient (davesnx/styled-ppx#464) by @davesnx
- Rename emotion-hash into murmur2 and remove public testing cli by @davesnx
- Use server-reason-react from opam by @davesnx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants