Skip to content

In some scenarios pre code/textarea elements not same size as enclosing code-input #135

@WebCoder49

Description

@WebCoder49

Steps to reproduce: Go to https://oliver.geer.im/teclat/, click on the moon button to switch to dark mode by changing the CSS colour (in this case right now, changing the value of a CSS variable), and see the following rather than the whole code-input element being dark as expected:

Screenshot with dark code-input rectangle covering most but not all of lighter space for it (which it should be filling) inside dark UI

The correctly-coloured portion is the extent of both the pre code and textarea elements. The mismatch in size may be due to some unusual CSS, e.g. the value of box-sizing here. When the code-input element gets typed in, the background colour but not the extent of the pre code/textarea, gets corrected, because the background colour is changed by JavaScript to match that of the pre code on each input.

(The JavaScript mentioned: needed in an earlier version but probably unnecessary now given now the pre code element resizes to the size of the code-input, but quick to run and for backwards compatibility it should be retained; mark it as deprecated in the source after checking it's not needed?).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:coreA bug/feature for the core code-input.js/code-input.css filesbugSomething isn't workingpriority:medium

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions