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

Support for Xamarin Forms css syntax #65

Open
dansiegel opened this issue Apr 22, 2018 · 3 comments
Open

Support for Xamarin Forms css syntax #65

dansiegel opened this issue Apr 22, 2018 · 3 comments

Comments

@dansiegel
Copy link

dansiegel commented Apr 22, 2018

Description

With the introduction of Xamarin Forms 3.0 css is now supported. While most of the css is generally valid css, there is a selector that is not typically supported for web applications. Having the ability to generate the css from Sass would be hugely beneficial but currently the Sass compiler generates an exception. I need a way that I can support compiling sass that uses the derived types syntax:

Selector Example Description
^base ^contentpage Selects all elements with ContentPage as base class, including ContentPage itself. Case irrelevant. This selector isn't present in the CSS specification, and only applies to XF.

Sample

As an example I might want to make all buttons have a transparent background whether I'm using the base Button class or some custom Button class.

^button {
  background-color: transparent;
}
@nschonni
Copy link
Contributor

This might require a change to the Sass language. You would need to request that to the sass/sass repo.
I don't think it would be accepted though since it wouldn't match the CSS selector allowed characters https://stackoverflow.com/a/4132824/455535

@dansiegel
Copy link
Author

@nschonni I thought each language is handled separately now, and I'm not trying to be so presumptuous as to say that all of Sass should be required to change. Since this is for Xamarin Forms developers, they're already working in .NET so making the change for the .NET library makes the most sense here. Ultimately all I need is some way to tell the Sass compiler to accept the special syntax with a preceding ^

@nschonni
Copy link
Contributor

This is a wrapper for libsass, and libsass won't add features that aren't in the Sass language. You could see if you can figure out a way to monkey patch it here though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants