Coder Social home page Coder Social logo

xamlcss's Introduction

XamlCSS

Style Xaml-applications with CSS - get it for WPF, Xamarin.Forms or UWP and start right here!

Why XamlCSS For XAML?

Concise

Styling with (s)css gives a more concise declaration of your styles. XamlCSS even supports a subset of SCSS features like selector nesting, css-variables and mixins. This enables you to make your declarations even more concise.

Freely Combine Styles

Other than vanilla Xaml-styles, css allows you to freely combine styles - no BasedOn restriction. Even better, this is done for you behind the curtains!
And if you really want to combine styles yourself use @extend.

Semantic Meaning

Semantic meaning can be conveyed, i.e. is your ui-element important, a warning, a header or a sub-header? This is achieved by using css-classes.

Based On View-Hierarchy

Css takes into account where inside your view-hierarchy your element gets added. No need to manually assigning a style.
It also detects that an element was added or removed.
In combination with semantic selectors you can style a button differently just because it is in a warning dialog. And if you want to create a dark, a light and a custom theme, just switch the css-class-name on your root view-element and all elements update themselves automatically.

Support For Xaml-Features

You can use markup-extensions and triggers in your (s)css.

In css you cannot declare an instance of an object as you can do in xaml. A Storyboard for example must be declared as usual in a ResourceDictionary but then can be referenced in css with a markup-extension.

Designer Support

XamlCSS builds on top of the native Xaml-Style implementations, so it works with the WPF and UWP designer. For Xamarin.Forms there is LiveXAML.

Supported platforms

Supported Features

  • CSS selectors
  • Remove and reapply styles
  • Detect new elements and apply matching styles
  • Support Binding * (except vanilla UWP)
  • Support StaticResource *
  • Support DynamicResource * (except vanilla UWP)
  • Set simple values like Foreground, FontSize, FontStyle,... by CSS
  • Triggers
  • Multiple StyleSheets
  • Nested selectors (like Sass)
  • Css-variables
  • Import of other css-files
  • Mixins

Not (yet) supported

  • Visual State Manager

For more information look at the provided test-apps in the solution to see how to initialize and use XamlCSS.

*) Breaking change in binding syntax in 2.0.0: instead of {Binding value} you now write #Binding value or "{Binding value}"

xamlcss's People

Contributors

warappa avatar richicoder1 avatar tpetrina avatar dependabot[bot] avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.