Functional and Design SpecificationGlossary
Summary and BackgroundWhen developers are using Spark components with the Spark theme, we want the compiler to report errors/warnings when Halo specific styles are used. Conversely, we want the compiler to report errors/warnings when Spark theme specific styles are used with MX components. Usage Scenarios
Detailed DescriptionDefaultsThe compiler will set the theme to <FLEX_HOME>/frameworks/themes/Spark/spark.css by default and flex-config.xml will contain a commented out example showing the default: <!-- The default theme -->
<!-- not set -->
<!--
<theme>
<file>themes/Spark/spark.css</file>
</theme>
-->
Style metadataFor this release, the Halo and Spark components will only have Style metadata with a theme attribute of "spark" or "halo". When no theme attribute is specified, the style applies to all themes. The compiler will use the theme attribute to validate styles defined in MXML and CSS. Here is an example of the Style metadata: [Style(name="baseColor", type="uint", format="Color", inherit="yes", theme="spark")] It is valid to specify multiple values for the theme attribute. For example: [Style(name="backgroundColor", type="uint", format="Color", inherit="yes", theme="halo,spark")] Configuring the theme name(s)The theme name(s) will be configured by a naming scheme where the first word prefix specifies the theme name or the base theme name. For example, halo.swc and halo-wooden.css mean the theme name will be halo and spark.swc and spark-wireframe.css mean the theme name will be spark. In the future, if we move Style metadata to the skins and add support to the compiler and tools for looking up Style metadata in the skinClass, then the naming scheme will no longer be necessary. CSS validationOnly CSS selectors with an associated type will be validated. An associated type is required in order for the compiler to lookup Style metadata. CSS selectors with an associated type include fully qualified type selectors, in addition to id and descendant selectors with a fully qualified subject. Class selectors, the universal selector, and unqualified type selectors do not have an assoicated type. For examples, see CSS Advanced Selectors. Unknown styles defined in defaults.css files and themes will be excluded from validation, because this allows custom themes to define new styles. Warnings and ErrorsFor MXML validation, errors will be reported. For example: The style 'dropShadowEnabled' is excluded by type 'mx.containers.ApplicationControlBar'. The style 'baseColor' is only supported by the theme(s) 'halo'. For CSS validation, warnings will be reported. For example: The style 'borderColor' is only supported by the theme(s) 'spark'. The style 'myColor' was not declared by type 'spark.components.Button'. The style 'dropShadowEnabled' is excluded by type 'mx.containers.ApplicationControlBar'. There will be a new configuration option, -show-invalid-css-property-warnings, for disabling the CSS warnings. The MXML errors will always be enabled. Custom themes
API DescriptionN/A B FeaturesNone. Examples and UsageSee "Usage Scenarios". Additional Implementation DetailsPrototype WorkA prototype of Plan A was completed, but we are not going to use it. A prototype of the current plan has also been implemented. Web Tier Compiler ImpactN/A Dependencies on other Flex features. Backwards CompatibilitySyntax changesN/A BehaviorWhen compatibility-version=3, the compiler will change the default theme to <FLEX_HOME>/frameworks/themes/Halo/halo.swc. Warnings/DeprecationN/A AccessibilityN/A PerformanceIt's not expected that this feature will noticeably affect performance. GlobalizationN/A LocalizationCompiler FeaturesNew errors and warnings will be added to compiler_en.properties. Framework FeaturesN/A Issues and Recommendations
DocumentationQASee "Usage Scenarios". |
|
| You must be logged in to comment. |
|---|
