{"id":"css-rem-to-px","version":"1.0.0","description":"Convert rem or em to px using a supplied root or parent font size; returns an exactly rounded pixel length.","supported_operations":["convert rem to px","calculate pixels from rem","1.5rem in pixels with 16px root","convert em to pixels with parent font size","pixel value for an em size","multiply relative CSS length by its font size"],"unsupported_operations":["resolve the browser root or parent style","evaluate calc() or CSS variables","convert viewport or container units"],"semantics":["relative_unit rem requires root_font_size_px; relative_unit em requires parent_font_size_px, and the other context field is rejected.","The exact result is value multiplied by the supplied positive context font size; decimal strings are parsed as rational numbers.","decimals selects 0 through 18 digits after the decimal point; ties round away from zero and trailing zeroes are retained.","CSS font-relative semantics follow CSS Values and Units Level 4 WD 2024-03-12, section 6.1; no browser style resolution is performed."],"limits":{"max_input_bytes":256,"max_decimal_chars":64,"max_decimals":18,"max_items":1,"max_iterations":80,"max_output_bytes":256},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"required":["value","relative_unit","decimals"],"properties":{"value":{"type":"string","minLength":1,"maxLength":64,"pattern":"^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$"},"relative_unit":{"type":"string","enum":["rem","em"]},"root_font_size_px":{"type":"string","minLength":1,"maxLength":64,"pattern":"^(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$"},"parent_font_size_px":{"type":"string","minLength":1,"maxLength":64,"pattern":"^(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$"},"decimals":{"type":"integer","minimum":0,"maximum":18}}},"output_schema":{"type":"object","additionalProperties":false,"required":["value","unit","standard_version","data_version"],"properties":{"value":{"type":"string"},"unit":{"const":"px"},"standard_version":{"const":"CSS Values and Units Level 4 WD 2024-03-12"},"data_version":{"const":"css-absolute-length-ratios-2024-03-12"}}},"examples":[{"input":{"value":"1.5","relative_unit":"rem","root_font_size_px":"16","decimals":2},"output":{"value":"24.00","unit":"px","standard_version":"CSS Values and Units Level 4 WD 2024-03-12","data_version":"css-absolute-length-ratios-2024-03-12"}},{"input":{"value":"0.833333","relative_unit":"em","parent_font_size_px":"24","decimals":3},"output":{"value":"20.000","unit":"px","standard_version":"CSS Values and Units Level 4 WD 2024-03-12","data_version":"css-absolute-length-ratios-2024-03-12"}}],"execute_url":"/v1/tools/css-rem-to-px/versions/1.0.0/execute"}