2 Star 0 Fork 0

chromium_develop/chromium_tools

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
accessibility
android
binary_size
bisect_repackage
cfi
check_ecs_deps
checkbins
checklicenses
checkperms
checkteamtags
chrome_extensions/open_my_editor
clang
code_coverage
compile_test
coverity
cr
cros
cygprofile
determinism
diagnosis
dromaeo_benchmark_runner
dump_process_memory
emacs
find_runtime_symbols
flags
flakiness
fuchsia
gdb
generate_library_loader
generate_shim_headers
generate_stubs
get_swarming_logs
git
gn
grit
gritsettings
idl_parser
imagediff
infra
ipc_fuzzer
json_comment_eater
json_schema_compiler
json_to_struct
l10n
linux
lldb
luci-go
mac
mb
md_browser
media_engagement_preload
memory
memory_inspector
metrics
msan
oopif
origin_trials
page_cycler
perf
polymer
privacy_budget
protoc_wrapper
python
real_world_impact
resources
resultdb
security
site_compare
skia_goldctl/linux
stats_viewer
strict_enum_value_checker
style_variable_generator
.style.yapf
DEPS
OWNERS
PRESUBMIT.py
README.md
__init__.py
additional_colors_test.json5
base_generator.py
base_generator_test.py
color.py
color_test.py
colors_test.json5
colors_test_custom_dark_toggle_expected.css
colors_test_dark_only_expected.css
colors_test_expected.css
colors_test_expected.h
colors_test_expected.proto
colors_test_expected.protojson
colors_test_palette.json5
css_generator.py
css_generator.tmpl
find_invalid_css_variables.py
find_invalid_css_variables_test.py
opacity.py
path_overrides.py
presubmit_support.py
proto_generator.py
proto_generator.tmpl
proto_json_generator.tmpl
style_variable_generator.gni
style_variable_generator.py
style_variable_generator_test.py
views_generator.py
views_generator_h.tmpl
sublime
swarming_client
symsrc
tcmalloc
tests
traceline
traffic_annotation
translation
ubsan
usb_gadget
v8_context_snapshot
valgrind
variations
vim
vscode
web_bluetooth
web_dev_style
win
.style.yapf
DEPS
DIR_METADATA
OWNERS
README.en.md
README.md
auto-nav.py
autotest.py
bash-completion
bisect-builds.py
bisect_test.py
boilerplate.py
buildstate.bat
buildstate.py
check_git_config.py
check_grd_for_unused_strings.py
clang-format-js
diagnose-me.py
download_optimization_profile.py
gypv8sh.py
include_tracer.py
ipc_messages_log.py
licenses.py
make-gtest-filter.py
multi_process_rss.py
nocompile_driver.py
omahaproxy.py
perry.py
remove_duplicate_includes.py
remove_stale_pyc_files.py
roll_webgl_conformance.py
run-swarmed.py
sort-headers.py
sort_sources.py
uberblame.py
unused-symbols-report.py
update_pgo_profiles.py
yes_no.py
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

style_variable_generator

This is a python tool that generates cross-platform style variables in order to centralize UI constants.

This script uses third_party/pyjson5 to read input json5 files and then generates various output formats as needed by clients (e.g CSS Variables, preview HTML page).

For input format examples, see the *_test.json5 files which contain up to date illustrations of each feature, as well as expected outputs in the corresponding *_test_expected.* files.

Run python style_variable_generator.py -h for usage details.

Generator Options

CSS

Dark mode selector

--generator-option 'dark_mode_selector=html[dark]'

Replaces the default media query (@media (prefers-color-scheme: dark)) which triggers colors to switch to dark mode with a custom css selector. The example above would produce

html[dark] {
    ...dark mode colors
}

instead of the default

@media (prefers-color-scheme: dark) {
    html:not(body) {
        ... colors
    }
}

This should only be used if you want to generate a stylesheet for testing where you can control the switch to dark/light mode, in production always prefer to use the default behavior which will respect operating system level dark mode switches.

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/chromium_develop/chromium_tools.git
git@gitee.com:chromium_develop/chromium_tools.git
chromium_develop
chromium_tools
chromium_tools
master

搜索帮助