You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: contributor-docs/feature-flag-testing.md
+25-1Lines changed: 25 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,26 @@ npm i @primer/primitives-my-feature-flag@npm:@primer/[email protected]
51
51
52
52
**NOTE:** This package needs to be checked into git. On dotcom all packages are added in git.
53
53
54
-
### Create a new bundle (optional)
54
+
### Load your file
55
+
56
+
#### Option 1: SCSS feature flag
57
+
58
+
[Read more about scss feature flags](https://github.com/github/github/blob/10168573894287782ddabd7d8b9bfd47850a1b31/ui/packages/feature-flags/client-feature-flags.ts#L223-L233).
59
+
60
+
You can't use `@import` inside a feature flag as `@import` has to be top level.
61
+
62
+
> Note: these flags are all automatically preloaded
63
+
64
+
```scss
65
+
* CSS feature flags can be used in any scss/css file like this:
66
+
*
67
+
* [data-css-features~="my_feature_flag" i] {
68
+
*// styles behind flag
69
+
* }
70
+
*
71
+
```
72
+
73
+
#### Option 2: Create a new bundle
55
74
56
75
If you want to load some new tokens you can add a new bundle and load it for users who have the feature flags enabled.
57
76
@@ -71,6 +90,11 @@ You now need to load your css bundle if the feature flag is active by placing th
71
90
72
91
Now you need to generate the `SERVICEOWNERS` and `CODEOWNERS` by running `bin/generate-service-files.rb` in the console or by running it as a task in vs code.
73
92
93
+
>Note: to run a task in vscoode, open the command palette with `cmd + shift +p`or add a `>`in to the search palette and type `run task`.
94
+
>Select`Tasks: Run Task`and hit `return`
95
+
>Select`bin/generate-service-files.rb` fromn the list and hit `return`
96
+
>Select`Default`and hit return
97
+
74
98
It should add a line like this to the `SERVICEOWNERS`:
0 commit comments