IntendaUK / opus-ui

MIT License
6 stars 0 forks source link

Styles that define empty media queries cause a crash #8

Closed bigbadwofl closed 5 months ago

bigbadwofl commented 5 months ago

Describe the bug

The following would cause a crash:

{
    "type": "containerSimple",
    "prps": {
        "style": {
        ".cpnContainerSimple": {
            "@media only screen and (max-width: 200px)": {}
        }
    }
}

image

Reproduction

import React from 'react';
import { createRoot } from 'react-dom/client';
import Opus, { Component } from './library';

const OpusUI = () => {
    return (
        <div>
            <Component mda={{
                type: 'containerSimple',
                prps: {
                    style: {
                        '.cpnContainerSimple': {
                            '@media only screen and (max-width: 600px)': {}
                        }
                    }
                }
            }} />
        </div>
    );
};

const root = createRoot(document.getElementById('root'));

root.render(<Opus startupComponent={<OpusUI />} />);

Logs

No response

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (32) x64 AMD Ryzen 9 7950X 16-Core Processor
    Memory: 18.90 GB / 31.16 GB
  Binaries:
    Node: 20.11.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.2.3 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 125.0.6422.142
    Edge: Chromium (123.0.2420.97)
    Internet Explorer: 11.0.19041.4355

Severity

blocking all usage of opus ui

bigbadwofl commented 5 months ago

Fixed in version 1.1.8