5 lines
26 KiB
JSON
5 lines
26 KiB
JSON
{
|
|
"id": "api/animations/style",
|
|
"title": "style",
|
|
"contents": "\n\n<article>\n <div class=\"breadcrumb-container\">\n <div class=\"breadcrumb\">\n <script type=\"application/ld+json\">\n {\n \"@context\": \"http://schema.org\",\n \"@type\": \"BreadcrumbList\",\n \"itemListElement\": [\n { \"@type\": \"ListItem\", \"position\": 1, \"item\": { \"@id\": \"https://angular.io//api\", \"name\": \"API\" } },\n { \"@type\": \"ListItem\", \"position\": 2, \"item\": { \"@id\": \"https://angular.io/api/animations\", \"name\": \"@angular/animations\" } },\n { \"@type\": \"ListItem\", \"position\": 3, \"item\": { \"@id\": \"https://angular.io/api/animations/style\", \"name\": \"style\" } }\n ]\n }\n </script>\n <a href=\"/api\">API</a> > <a href=\"api/animations\">@angular/animations</a>\n </div>\n <div class=\"github-links\">\n <a href=\"https://github.com/angular/angular/edit/master/packages/animations/src/animation_metadata.ts?message=docs(animations)%3A%20describe%20your%20change...#L744-L787\" aria-label=\"Suggest Edits\" title=\"Suggest Edits\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">mode_edit</i></a>\n <a href=\"https://github.com/angular/angular/tree/12.0.0-next.7/packages/animations/src/animation_metadata.ts#L744-L787\" aria-label=\"View Source\" title=\"View Source\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">code</i></a>\n</div>\n </div>\n \n <header class=\"api-header\">\n <h1 id=\"style\">style<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/animations/style#style\"><i class=\"material-icons\">link</i></a></h1>\n \n <label class=\"api-type-label function\">function</label>\n \n \n \n </header>\n \n <aio-toc class=\"embedded\"></aio-toc>\n\n <div class=\"api-body\">\n \n <section class=\"short-description\">\n <p>Declares a key/value object containing CSS properties/styles that\ncan then be used for an animation <code><a href=\"api/animations/state\" class=\"code-anchor\">state</a></code>, within an animation <code><a href=\"api/animations/sequence\" class=\"code-anchor\">sequence</a></code>,\nor as styling data for calls to <code><a href=\"api/animations/animate\" class=\"code-anchor\">animate</a>()</code> and <code><a href=\"api/animations/keyframes\" class=\"code-anchor\">keyframes</a>()</code>.</p>\n\n \n </section>\n \n \n \n\n <div class=\"overload-info\">\n \n\n <code-example language=\"ts\" hidecopy=\"true\" class=\"no-box api-heading\"> <span class=\"member-name\"><a href=\"api/animations/style\" class=\"code-anchor\">style</a></span>(tokens: \"*\" | { [key: string]: string | <a href=\"api/common/DecimalPipe\" class=\"code-anchor\">number</a>; } | (\"*\" | { [key: string]: string | <a href=\"api/common/DecimalPipe\" class=\"code-anchor\">number</a>; })[]): <a href=\"api/animations/AnimationStyleMetadata\" class=\"code-anchor\">AnimationStyleMetadata</a></code-example>\n\n \n\n <h6 class=\"no-anchor\" id=\"parameters\">Parameters</h6>\n <table class=\"is-full-width list-table parameters-table function-overload-parameters\">\n <tbody>\n \n <tr class=\"function-overload-parameter\">\n <td class=\"param-name\">\n <a id=\"\"></a>\n <code>tokens</code>\n </td>\n <td class=\"param-type\"><code>\"*\" | { [key: string]: string | <a href=\"api/common/DecimalPipe\" class=\"code-anchor\">number</a>; } | (\"*\" | { [key: string]: string | <a href=\"api/common/DecimalPipe\" class=\"code-anchor\">number</a>; })[]</code></td>\n <td class=\"param-description\">\n <p>A set of CSS styles or HTML styles associated with an animation state.\nThe value can be any of the following:</p>\n<ul>\n<li>A key-value style pair associating a CSS property with a value.</li>\n<li>An array of key-value style pairs.</li>\n<li>An asterisk (*), to use auto-styling, where styles are derived from the element\nbeing animated and applied to the animation when it starts.</li>\n</ul>\n<p>Auto-styling can be used to define a state that depends on layout or other\nenvironmental factors.</p>\n\n </td>\n </tr>\n </tbody>\n</table>\n\n \n <h6 class=\"no-anchor\" id=\"returns\">Returns</h6>\n <p><code><a href=\"api/animations/AnimationStyleMetadata\" class=\"code-anchor\">AnimationStyleMetadata</a></code>: An object that encapsulates the style data.</p>\n \n \n\n\n \n\n \n</div>\n\n\n \n\n \n\n\n\n \n<section class=\"usage-notes\">\n <h2 id=\"usage-notes\">Usage notes<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/animations/style#usage-notes\"><i class=\"material-icons\">link</i></a></h2>\n <p>The following examples create animation styles that collect a set of\nCSS property values:</p>\n<code-example language=\"typescript\">\n// string values for CSS properties\n<a href=\"api/animations/style\" class=\"code-anchor\">style</a>({ background: \"red\", color: \"blue\" })\n\n// numerical pixel values\n<a href=\"api/animations/style\" class=\"code-anchor\">style</a>({ width: 100, height: 0 })\n</code-example>\n<p>The following example uses auto-styling to allow a component to animate from\na height of 0 up to the height of the parent element:</p>\n<code-example>\n<a href=\"api/animations/style\" class=\"code-anchor\">style</a>({ height: 0 }),\n<a href=\"api/animations/animate\" class=\"code-anchor\">animate</a>(\"1s\", <a href=\"api/animations/style\" class=\"code-anchor\">style</a>({ height: \"*\" }))\n</code-example>\n\n</section>\n\n\n\n </div>\n</article>\n\n<!-- links to this doc:\n - api/animations\n - api/animations/AnimationBuilder\n - api/animations/AnimationMetadataType\n - api/animations/AnimationStyleMetadata\n - api/animations/animate\n - api/animations/animation\n - api/animations/group\n - api/animations/keyframes\n - api/animations/query\n - api/animations/sequence\n - api/animations/stagger\n - api/animations/state\n - api/animations/transition\n - api/core/Renderer2\n - guide/animations\n - guide/attribute-binding\n - guide/binding-syntax\n - guide/complex-animation-sequences\n - guide/component-styles\n - guide/deprecations\n - guide/docs-style-guide\n - guide/elements\n - guide/migration-renderer\n - guide/reusable-animations\n - guide/route-animations\n - guide/router-tutorial-toh\n - guide/security\n - guide/style-precedence\n - guide/transition-and-triggers\n-->\n<!-- links from this doc:\n - /api\n - api/animations\n - api/animations/AnimationStyleMetadata\n - api/animations/animate\n - api/animations/keyframes\n - api/animations/sequence\n - api/animations/state\n - api/animations/style#style\n - api/animations/style#usage-notes\n - api/common/DecimalPipe\n - https://github.com/angular/angular/edit/master/packages/animations/src/animation_metadata.ts?message=docs(animations)%3A%20describe%20your%20change...#L744-L787\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/animations/src/animation_metadata.ts#L744-L787\n-->"
|
|
} |