• Christopher Lam's avatar
    [style_var_gen] Refactor model. · 3ca5df0c
    Christopher Lam authored
    This CL refactors the model to more closely match the data. In particular,
    the model used to be colors[mode][name] and is now colors[name][mode],
    which matches the data. This is in preparation for implementing
    opacities, a 'generate-dark-mode-only' mode, and dark-mode-agnostic
    properties.
    
    Other minor changes:
    - BaseGenerator.colors is now BaseGenerator.model[VariableType.COLOR]
    - ModeVariables now has methods that let it be used more like a dict()
    
    Bug: 1018654
    Change-Id: I5422178053434b49ac64a6290983092cbbbf0ab0
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2245968
    Commit-Queue: calamity <calamity@chromium.org>
    Reviewed-by: default avatarGiovanni Ortuño Urquidi <ortuno@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#780201}
    3ca5df0c
css_generator.py 2.49 KB