Visitar URL original
Removing a css property (margin-top) does not reset it to it's fallback (margin) · Issue #9997 · NativeScript/NativeScript · GitHub
The Wayback Machine - https://web.archive.org/web/20260605023635/https://github.com/NativeScript/NativeScript/issues/9997
Skip to content

Removing a css property (margin-top) does not reset it to it's fallback (margin) #9997

@edusperoni

Description

@edusperoni

Issue Description

Given the following classes:

.default-margins {
  margin: 100 10 10 10;
}

.big-margins {
  margin-top: 500;
}

If you add the class default-margins, you'll have the correct margins. When you add big-margins it then becomes margin-top 500 while keeping the other margins.

When big-margins is removed, margin-top returns to 0 instead of falling back to the values provided in default-margins.

I imagine this happens with all other similar properties (background, padding, margin, etc)

might be related: #8141

Reproduction

https://stackblitz.com/edit/nativescript-stackblitz-templates-ip46oh?file=src%2Fapp%2Fitem%2Fitems.component.html,src%2Fapp%2Fitem%2Fitems.component.ts,src%2Fapp.css&title=NativeScript%20Starter%20Angular

you can use the preview for this. Tap the button, see the margin expand. tap the button again, margin will become 0.

Relevant log output (if applicable)

No response

Environment

latest nativescript, reproducible in preview.

Please accept these terms

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions