Skip to content

(feature) CSS calc function #418

Open

Description

@KingAmo

Describe the issue

import { css } from 'react-strict-dom';

const styles = css.create({
  test: {
    width: 150,
    height: 'calc(100px + 50px)',
    backgroundColor: 'pink',
  },
});

css calc not work in react native (it works in web)

Expected behavior

css calc works in react native

Steps to reproduce

code above

Test case

No response

Additional comments

No response

Activity

  1. KingAmo commented on Oct 30, 2025

    @KingAmo
    Author

    https://facebook.github.io/react-strict-dom/api/css/#compatibility

    i find the Compatibility section in doc, calc not support yet

  2. KingAmo commented on Oct 30, 2025

    @KingAmo
    Author

    is there any plan to support calc in react native?

  3. changed the title [-]css calc not work in react native[/-] [+](feature) CSS calc function[/+] on Oct 30, 2025
  4. necolas commented on Oct 30, 2025

    @necolas
    Contributor

    Yes there is the intent to support calc in RN but it's blocked on landing a CSS unit parser, which is itself stalled.

    FWIW, you don't need calc if the units are the same as in your example.

  5. added
    featureFeature or technical request
    and removed
    bugSomething isn't working
    on Oct 30, 2025
  6. KingAmo commented on Oct 30, 2025

    @KingAmo
    Author

    Yes there is the intent to support calc in RN but it's blocked on landing a CSS unit parser, which is itself stalled.

    FWIW, you don't need calc if the units are the same as in your example.

    i am using react-strict-dom in a brown field react-native project , i want to pollyfill env(safe-area-inset-bottom) , so there are use case like height: 'calc(env(safe-area-inset-bottom) + 50px)'

    so there is another question, if i already have Device.safeArea.bottom , how to pollyfill env(safe-area-inset-bottom) in react strict dom?
    currently i use patch-package to patch react-strict-dom:

    Image
  7. MoOx commented on May 22, 2026

    @MoOx
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureFeature or technical request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions