ember-scoped-css 3.2.0 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -496,20 +496,27 @@ const Outer = <template>
496
496
 
497
497
  ### Passing classes as arguments to a component
498
498
 
499
- There is a `scopedClass` helper that you can use to pass a class name as an argument to a component. The helper takes a class name and returns a scoped class name. `scopedClass` helper is replaced at build time so there is no performance hit when running the app.
499
+ There is a `scopedClass` helper that you can use to pass a class name as an argument to a component. The helper takes a class name — or a space-separated list of class names — and returns the scoped equivalent. `scopedClass` helper is replaced at build time so there is no performance hit when running the app.
500
500
 
501
501
  ```gjs
502
502
  import { scopedClass } from 'ember-scoped-css';
503
503
 
504
504
  <template>
505
505
  <OtherComponent @internalClass={{scopedClass 'hello-class'}} />
506
- <OtherComponent @internalClass={{(scopedClass 'hello-class')}} />
507
- <OtherComponent
508
- @internalClass={{concat (scopedClass 'hello-class') ' other-class'}}
509
- />
506
+ <OtherComponent @internalClass={{scopedClass 'hello-class other-class'}} />
507
+ <OtherComponent @internalClass="{{scopedClass 'hello-class'}} global-class" />
510
508
  </template>
511
509
  ```
512
510
 
511
+ Every class in the argument is scoped, so
512
+ ```hbs
513
+ <div class={{scopedClass 'hello-class other-class'}}>
514
+ ```
515
+ is equivalent to
516
+ ```hbs
517
+ <div class="{{scopedClass 'hello-class'}} {{scopedClass 'other-class'}}">
518
+ ```
519
+
513
520
  ## Testing
514
521
 
515
522
  As classes are renamed during the build process you can't directly verify if classes are present in your tests. To solve this problem you can use the `scopedClass` function from the `ember-scoped-css/test-support` module. The function takes the class names and path to the CSS file where are the classes defined and returns the scoped class names.