★ wanayoo — archive 1999 https://github.com/NativeScript/NativeScript/issues/859Nouvelle recherche | Portail wanayoo
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow borders to be applied on a per-side basis in CSS #859

Closed
tjvantoll opened this issue Sep 30, 2015 · 58 comments · Fixed by #2743
Closed

Allow borders to be applied on a per-side basis in CSS #859

tjvantoll opened this issue Sep 30, 2015 · 58 comments · Fixed by #2743

Comments

@tjvantoll
Copy link
Contributor

tjvantoll commented Sep 30, 2015 •

I'm finding that I frequently need to put a border on one side of a UI component, but NativeScript currently does not support this. I'm requesting that the following CSS properties be added:

  • border-top-width
  • border-top-color
  • border-right-width
  • border-right-color
  • border-bottom-width
  • border-bottom-color
  • border-left-width
  • border-left-color

To be consistent with CSS, I would also like the border-width and border-color shorthands to work like they do in CSS.

screen shot 2015-09-30 at 8 17 47 am

Update: You can vote for this feature at https://nativescript.ideas.aha.io/ideas/NS-I-110.

Thanks.

@lscown
Copy link

lscown commented Oct 1, 2015

Yes please 👍

@PeterStaev
Copy link
Contributor

PeterStaev commented Oct 1, 2015

👍

2 similar comments
@tsvetan-ganev
Copy link

tsvetan-ganev commented Oct 1, 2015

👍

@kishmiryan-karlen
Copy link

kishmiryan-karlen commented Oct 5, 2015

👍

@kishmiryan-karlen
Copy link

kishmiryan-karlen commented Oct 5, 2015

@tjvantoll do you have any workaround now?

@kvelikov
Copy link
Contributor

kvelikov commented Oct 14, 2015

👍

@rclai
Copy link
Contributor

rclai commented Nov 5, 2015

So how do we set a border to a specific side right now?

@tjvantoll
Copy link
Contributor Author

tjvantoll commented Nov 5, 2015

What I’ve been doing is something like <stack-layout style="height: 2; border-color: red; border-width: 2;"></stack-layout>, which is definitely hacky, but it works until per-side borders are truly supported.

@rclai
Copy link
Contributor

rclai commented Nov 5, 2015

Oh haha okay, thanks.

@tenorok
Copy link

tenorok commented Nov 22, 2015

It feature is just vital! 👍

@stevetayloruk
Copy link

stevetayloruk commented Nov 23, 2015

+1

3 similar comments
@sitefinitysteve
Copy link
Contributor

sitefinitysteve commented Dec 8, 2015

+1

@karlix
Copy link

karlix commented Dec 8, 2015

+1

@firescript
Copy link

firescript commented Dec 16, 2015

+1

@RusEu
Copy link

RusEu commented Jan 2, 2016

So how do we set a border to a specific side right now? Like the TabView does for the border-bottom?

@tiagordc
Copy link

tiagordc commented Jan 7, 2016

+1

1 similar comment
@sudomf
Copy link

sudomf commented Jan 19, 2016

+1

@ghost
Copy link

ghost commented Feb 1, 2016

+5

@lelong37
Copy link

lelong37 commented Feb 8, 2016

+1

5 similar comments
@dragGH102
Copy link

dragGH102 commented Feb 11, 2016

+1

@nripendra
Copy link

nripendra commented Feb 19, 2016

+1

@Premitium
Copy link

Premitium commented Feb 23, 2016

+1

@gadonski
Copy link

gadonski commented Mar 1, 2016

+1

@treio
Copy link

treio commented Mar 4, 2016

+1

@sitefinitysteve
Copy link
Contributor

sitefinitysteve commented Mar 7, 2016

Common, lets tag this with "high" we all need it, height:1 StackLayout is suuuuper bloaty and hacky

@PanayotCankov
Copy link
Contributor

PanayotCankov commented Mar 9, 2016

👍

@philpalmieri
Copy link

philpalmieri commented Aug 24, 2016

FWIW, I just use a background image for what i've needed so far ( a single line underneath an element)

@ahmedelgendy
Copy link

ahmedelgendy commented Aug 29, 2016

+1

1 similar comment
@mragwa
Copy link

mragwa commented Aug 29, 2016

+1

@hamorphis
Copy link
Contributor

hamorphis commented Sep 17, 2016

#2743 adds basic support for non-uniform borders.

Current limitations are:

  • Different border radii on the four corners are not yet supported
  • Border radius is supported only when the border width and color is uniform on all four sides.
  • Images on iOS will still render behind the border as they always have, until a fix is provided.

@hamorphis hamorphis added ready for test TSC needs to test this and confirm against live production apps and automated test suites and removed in progress labels Sep 17, 2016
@hamorphis
Copy link
Contributor

hamorphis commented Sep 17, 2016

screenshot_20160917-161341
simulator screen shot sep 17 2016 4 14 45 pm

@sitefinitysteve
Copy link
Contributor

sitefinitysteve commented Sep 17, 2016

... So happy right now

@hamorphis
Copy link
Contributor

hamorphis commented Sep 17, 2016 •

:neckbeard:

@hamorphis hamorphis added done and removed ready for test TSC needs to test this and confirm against live production apps and automated test suites labels Sep 19, 2016
@JoshDSommer
Copy link
Contributor

JoshDSommer commented Sep 19, 2016

Awesome!!!

@hamorphis
Copy link
Contributor

hamorphis commented Sep 20, 2016 •

Outstanding issues

  • Support uniform and non-uniform border radii on non-uniform border colors and/or widths.
  • Some iOS components such as Image, HtmlView and ListView will render behind the borders. Quick workaround is to place the component inside one of our Layouts and set the borders on the Layout instead.
  • iOS ScrollView cannot render non-uniform borders nicely with the current approach of adding for child layers to the UIView in order to draw the borders. When scrolling starts these 4 layers fly all around the place.
  • Android ScrollView draws no borders at all.

NOTE: Progress, Slider, Switch and SearchBar do not render borders by design.

@lock
Copy link

lock bot commented Aug 29, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Aug 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.