{"id":13743874,"url":"https://github.com/jeremyruppel/sass4as","last_synced_at":"2025-03-23T16:13:24.314Z","repository":{"id":1029575,"uuid":"857754","full_name":"jeremyruppel/sass4as","owner":"jeremyruppel","description":"Syntactically Awesome Stylesheets for ActionScript 3","archived":false,"fork":false,"pushed_at":"2010-08-25T18:40:53.000Z","size":9264,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-28T22:18:51.345Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"ActionScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jeremyruppel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-08-23T21:40:06.000Z","updated_at":"2012-12-15T02:43:39.000Z","dependencies_parsed_at":"2022-07-06T03:00:30.078Z","dependency_job_id":null,"html_url":"https://github.com/jeremyruppel/sass4as","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremyruppel%2Fsass4as","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremyruppel%2Fsass4as/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremyruppel%2Fsass4as/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremyruppel%2Fsass4as/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeremyruppel","download_url":"https://codeload.github.com/jeremyruppel/sass4as/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245128130,"owners_count":20565206,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T05:00:58.782Z","updated_at":"2025-03-23T16:13:24.292Z","avatar_url":"https://github.com/jeremyruppel.png","language":"ActionScript","funding_links":[],"categories":["File Formats"],"sub_categories":["CSS"],"readme":"# Sass4as\n\nSyntactially Awesome Stylesheets for ActionScript 3, a scaled-back [Sass](http://sass-lang.com) parser for AS3.\n\nUsing CSS to externally define styles in Flash applications is a **good practice**. But in projects that have designs and clients that change and increase in complexity frequently, they become very hard to maintain and update and quickly turn into style soup.\n\n## Enter Sass\n\n[Sass](http://sass-lang.com) rocks. Hard. It's a new way of writing CSS, letting you use variables, selector inheritance, mixins, and helper methods to super-charge your stylesheets, all while generally reducing filesize and increasing readability.\n\nThe Sass4as project is a parser for Sass documents that converts them to native Flash StyleSheet objects. Similar to how Flash's HTML parser does not support every facet of CSS, like descendant selectors, Sass4as does not support every facet of Sass, like descendant selectors.\n\nThe goal is to support every single awesome thing Sass does that makes sense in Flash.\n\n## How to use the SassParser\n\nGiven the stylesheet below...\n\n\t/* css/site.sass */\n\t$bold: Helvetica Neue LT Std 85 Heavy\n\t$blue: #001bf8\n\t\n\tbase\n\t  font-family: $bold\n\t  color: $blue\n\t\n\theader\n\t  @extend base\n\t  font-size: 24pt\n\t\n\tbody\n\t  @extend base\n\t  font-size: 14pt\n\n... loaded into a variable called sass:String.\n\n\timport com.jeremyruppel.sass4as.parser.SassParser;\n\t\n\tvar parser : SassParser = new SassParser( );\n\t\n\tvar styleSheet : StyleSheet = parser.parseSass( sass );\n\t\n\ttrace( styleSheet.styleNames ); // =\u003e base, header, body\n\ttrace( styleSheet.getStyle( 'body' ).fontFamily ) // =\u003e Helvetica Neue LT Std 85 Heavy\n\nAnd there you go. Apply that sucker to your TextFields and get to work.\n\nThe default SassParser implementation also retains style definitions, so you can combine multiple stylesheets into one StyleSheet instance. *Think of the benefits for localization!*\n\n## The Basics of Sass4as\n\n**No curly braces**\n  \nSass is an indentation-based language, so selector declarations do not need to be bound by curly braces\n  \n**No semicolons**\n\nFor the same reason, attribute declarations do not need to end with semicolons\n\n**No tabs**\n\nTo set a standard for indentation, selectors are declared at the start of a line and attributes are declared by inserting exactly two spaces.\n\n**No .class or #id selectors**\n\nTaking advantage of Flash's loose HTML parser, styles should be declared by implicit class. Meaning:\n\nBad:\n\t\n\t.highlight\n\t  color: #ff00ff\n\t\n\t\u003cspan class=\"highlight\"\u003eText\u003c/span\u003e\n\nGood:\n\n\thighlight\n\t  color: #ff00ff\n\t\n\t\u003chighlight\u003eText\u003c/highlight\u003e\n\t\nThe use of implicit style classes greatly enhances readability in your markup.\n\nThe [Sass4as TextMate Bundle](http://github.com/jeremyruppel/sass4as-tmbundle) has syntax highlighting and a few useful commands to help out while editing .sass documents.\n\n## Variables\n\nIn sass documents, you can declare variables and reference them later in your document.\n\n\t$black: $121212\n\t$font: Helvetica Neue\n\t\n\theader\n\t  color: $black\n\t  font-family: $font\n\t  font-size: 24pt\n\t\n\tbody\n\t  color: $black\n\t  font-family: $font\n\t  font-size: 14pt\n\n**Note: A variable must be declared ahead of any reference to it in the document**\n\n## Selector Inheritance\n\nIn sass documents, you can easily extend classes with the `@extend` directive. Attributes are assigned in order, so you can overwrite them if you wish.\n\n\tfont-base\n\t  color: #121212\n\t  font-family: Helvetica Neue\n\t  font-size: 12pt\n\t  display: inline\n\t\n\theader\n\t  @extend font-base\n\t  font-size: 24pt\n\t\n\tbody\n\t  @extend font-base\n\n**Note: A class must be declared ahead of any reference to it in the document**\n\nYou can also declare the star \"*\" selector and all subsequent classes will inherit from it automatically.\n\n\t*\n\t  display: inline\n\t  font-family: Helvetica Neue\n\t\n\theader\n\t  font-size: 24pt\n\t\n\tbody\n\t  font-size: 12pt\n\n## Mixins\n\n**Mixins are not yet supported by the Sass4as parser, but they're in the works**\n\n## Helper Methods\n\n**Helper methods are not yet supported by the Sass4as parser, but they're in the works**\n\n## Other Notes\n\nBlock-style comments are not yet supported. Single-line comments work, though.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeremyruppel%2Fsass4as","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeremyruppel%2Fsass4as","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeremyruppel%2Fsass4as/lists"}