Skip to content

Commit b777c2d

Browse files
committed
feat(material/core): expose styling information to the docs site
Exposes information about the available tokens in each component to the docs site. This makes it easier for users to track down the available tokens, instead of inspecting it with the dev tools.
1 parent 7ad38ee commit b777c2d

File tree

37 files changed

+233
-1
lines changed

37 files changed

+233
-1
lines changed

src/components-examples/BUILD.bazel

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ package_docs_content(
3232
"//src/cdk:overviews": "overviews/cdk",
3333
"//src/material:overviews": "overviews/material",
3434

35+
# Package the extracted token information into the docs content.
36+
"//src/material:tokens": "tokens/material",
37+
3538
# Package the API docs for the Material and CDK package into the docs-content
3639
"//src:api-docs": "api-docs",
3740

src/material/BUILD.bazel

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ filegroup(
1919
srcs = ["//src/material/%s:overview" % name for name in MATERIAL_ENTRYPOINTS],
2020
)
2121

22+
filegroup(
23+
name = "tokens",
24+
srcs = ["//src/material/%s:tokens" % name for name in MATERIAL_ENTRYPOINTS],
25+
)
26+
2227
sass_library(
2328
name = "sass_lib",
2429
srcs = [

src/material/autocomplete/BUILD.bazel

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
load("//tools:defaults.bzl", "markdown_to_html", "ng_module", "ng_test_library", "ng_web_test_suite", "sass_binary", "sass_library")
1+
load(
2+
"//tools:defaults.bzl",
3+
"extract_tokens",
4+
"markdown_to_html",
5+
"ng_module",
6+
"ng_test_library",
7+
"ng_web_test_suite",
8+
"sass_binary",
9+
"sass_library",
10+
)
211

312
package(default_visibility = ["//visibility:public"])
413

@@ -27,6 +36,9 @@ ng_module(
2736
sass_library(
2837
name = "autocomplete_scss_lib",
2938
srcs = glob(["**/_*.scss"]),
39+
deps = [
40+
"//src/material/core:core_scss_lib",
41+
],
3042
)
3143

3244
sass_binary(
@@ -75,6 +87,11 @@ markdown_to_html(
7587
srcs = [":autocomplete.md"],
7688
)
7789

90+
extract_tokens(
91+
name = "tokens",
92+
srcs = [":autocomplete_scss_lib"],
93+
)
94+
7895
filegroup(
7996
name = "source-files",
8097
srcs = glob(["**/*.ts"]),

src/material/badge/BUILD.bazel

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
load(
22
"//tools:defaults.bzl",
3+
"extract_tokens",
34
"markdown_to_html",
45
"ng_module",
56
"ng_test_library",
@@ -72,6 +73,11 @@ markdown_to_html(
7273
srcs = [":badge.md"],
7374
)
7475

76+
extract_tokens(
77+
name = "tokens",
78+
srcs = [":badge_scss_lib"],
79+
)
80+
7581
filegroup(
7682
name = "source-files",
7783
srcs = glob(["**/*.ts"]),

src/material/bottom-sheet/BUILD.bazel

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
load(
22
"//tools:defaults.bzl",
3+
"extract_tokens",
34
"markdown_to_html",
45
"ng_module",
56
"ng_test_library",
@@ -81,6 +82,11 @@ markdown_to_html(
8182
srcs = [":bottom-sheet.md"],
8283
)
8384

85+
extract_tokens(
86+
name = "tokens",
87+
srcs = [":bottom_sheet_scss_lib"],
88+
)
89+
8490
filegroup(
8591
name = "source-files",
8692
srcs = glob(["**/*.ts"]),

src/material/button-toggle/BUILD.bazel

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
load(
22
"//tools:defaults.bzl",
3+
"extract_tokens",
34
"markdown_to_html",
45
"ng_module",
56
"ng_test_library",
@@ -70,6 +71,11 @@ markdown_to_html(
7071
srcs = [":button-toggle.md"],
7172
)
7273

74+
extract_tokens(
75+
name = "tokens",
76+
srcs = [":button_toggle_scss_lib"],
77+
)
78+
7379
filegroup(
7480
name = "source-files",
7581
srcs = glob(["**/*.ts"]),

src/material/button/BUILD.bazel

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
load(
22
"//tools:defaults.bzl",
3+
"extract_tokens",
34
"markdown_to_html",
45
"ng_module",
56
"ng_test_library",
@@ -107,6 +108,11 @@ markdown_to_html(
107108
srcs = [":button.md"],
108109
)
109110

111+
extract_tokens(
112+
name = "tokens",
113+
srcs = [":button_scss_lib"],
114+
)
115+
110116
filegroup(
111117
name = "source-files",
112118
srcs = glob(["**/*.ts"]),

src/material/card/BUILD.bazel

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
load(
22
"//tools:defaults.bzl",
3+
"extract_tokens",
34
"markdown_to_html",
45
"ng_module",
56
"ng_test_library",
@@ -58,6 +59,11 @@ markdown_to_html(
5859
srcs = [":card.md"],
5960
)
6061

62+
extract_tokens(
63+
name = "tokens",
64+
srcs = [":card_scss_lib"],
65+
)
66+
6167
filegroup(
6268
name = "source-files",
6369
srcs = glob(["**/*.ts"]),

src/material/checkbox/BUILD.bazel

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
load(
22
"//tools:defaults.bzl",
3+
"extract_tokens",
34
"markdown_to_html",
45
"ng_module",
56
"ng_test_library",
@@ -72,6 +73,11 @@ markdown_to_html(
7273
srcs = [":checkbox.md"],
7374
)
7475

76+
extract_tokens(
77+
name = "tokens",
78+
srcs = [":checkbox_scss_lib"],
79+
)
80+
7581
filegroup(
7682
name = "source-files",
7783
srcs = glob(["**/*.ts"]),

src/material/chips/BUILD.bazel

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
load(
22
"//tools:defaults.bzl",
3+
"extract_tokens",
34
"markdown_to_html",
45
"ng_module",
56
"ng_test_library",
@@ -94,6 +95,11 @@ markdown_to_html(
9495
srcs = [":chips.md"],
9596
)
9697

98+
extract_tokens(
99+
name = "tokens",
100+
srcs = [":chips_scss_lib"],
101+
)
102+
97103
filegroup(
98104
name = "source-files",
99105
srcs = glob(["**/*.ts"]),

0 commit comments

Comments
 (0)