You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/packages/docs/src/pages/limitations.mdx
+26-31Lines changed: 26 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,9 +6,9 @@ section: 50-Guides
6
6
7
7
The architecture or design of Compiled prevents some things that are possible with runtime libraries. There are also some features we would like to add to Compiled in the future that we have not yet.
8
8
9
-
## Runtime styles
9
+
## Dynamic selectors
10
10
11
-
Styles can't be created at runtime which includes dynamic selectors as well.
11
+
Styles with dynamic selectors can't be created (at runtime or extraction) and may result in missing styles. If the variable is a local static value instead it should work!
12
12
13
13
```jsx
14
14
/** @jsxImportSource @compiled/react */
@@ -25,45 +25,40 @@ const styles = css({
25
25
<div css={styles} />;
26
26
```
27
27
28
-
If a dynamic value resolves to a static constant value however, it will work!
28
+
## Mixing dynamic styles and indirect selectors
29
29
30
-
## Overlapping styles, caused by media queries and other at-rules
31
-
32
-
Media queries and other at-rules are sorted deterministically when stylesheet extraction is turned on. See [this page](/media-queries-and-other-at-rules) for more details of how the sorting works and what its limitations are.
30
+
You cannot mix dynamic styles and indirect selectors (eg. `div + label` or `div ~ label`) as the dynamic value will not be applied to the indirect selector.
33
31
34
-
## Unsupported features
35
-
36
-
Below is a non-exhaustive list of features that Compiled does not support. Some are features we would like to add to Compiled at some point in the future, while others are features that we don't plan to implement.
37
-
38
-
### Ternary operators
39
-
40
-
There is a bug where ternary operators in the `css` prop won't work:
41
-
42
-
```tsx
43
-
/**@jsxImportSource @compiled/react */
44
-
import { css } from'@compiled/react';
32
+
Example, this will result in `label` not having the inline `props.margin` applied as it will not have access to the CSS variable we inject:
Media queries and other at-rules are sorted deterministically when stylesheet extraction is turned on. See [this page](/media-queries-and-other-at-rules) for more details of how the sorting works and what its limitations are.
65
58
66
-
There is a [bug report on GitHub](https://github.com/atlassian-labs/compiled/issues/389) if you would like to stay updated.
59
+
## Unsupported features
60
+
61
+
Below is a non-exhaustive list of features that Compiled does not support. Some are features we would like to add to Compiled at some point in the future, while others are features that we don't plan to implement.
0 commit comments