NativeScript / NativeScript/NativeScript
CSS shorthand properties like margin gets overriden by margin-bottom
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 25.7k
- Forks
- 1.7k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 35
Description
Environment
- CLI: 6.1.2
- Android Runtime: 6.1.2
- Nativescript with Angular
- @nativescript/theme
Describe the bug
It seems like CSS properties like margin-bottom: 50px; override their shorthand counterpart margin: 0;. I've only tried on Android with Angular.
To Reproduce
- Create a Nativescript with angular project.
- Include the
@nativescript/theme. - Create two buttons on a page.
- Add the
h2class from the theme and a customhelloclass on the first button.
.hello {
margin: 0; /* doesn't remove the bottom margin from the button that has the h2 class. */
/* margin-bottom: 0; */ /* does remove the bottom margin if uncommented. */
}
- See that the first button has a bottom margin that is only removed if we uncomment the
margin-bottom: 0;.
Expected behavior
Shorthand properties like margin should not differ from using margin-bottom like it works on the web.
Sample project
https://play.nativescript.org/?template=play-ng&id=nGvrVO
Uncomment the margin-bottom in home.component.css to see that it will remove margin which should already be removed by the margin: 0 just above it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked NativeScript Angular sample and home.component.css, then reproduce the issue on Android with @nativescript/theme using the stated margin rules. Done means margin: 0 removes the themed bottom margin just as margin-bottom: 0 does.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, typescript
- Domain
- frontend, mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100