chromium/ui/webui/resources/css/BUILD.gn

# Copyright 2020 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//tools/grit/preprocess_if_expr.gni")
import("//ui/webui/resources/tools/generate_grd.gni")

include_polymer = !is_android && !is_ios

preprocess_manifest = "preprocessed_manifest.json"

generate_grd("build_grdp") {
  grd_prefix = "webui_css"
  out_grd = "$target_gen_dir/resources.grdp"
  public_deps = [ ":preprocess" ]
  manifest_files = [ "$target_gen_dir/$preprocess_manifest" ]
  resource_path_prefix = "css"
}

preprocess_if_expr("preprocess") {
  visibility = [ ":build_grdp" ]
  in_folder = "."
  out_folder = "$target_gen_dir/preprocessed"
  out_manifest = "$target_gen_dir/$preprocess_manifest"
  in_files = [
    "action_link.css",
    "chrome_shared.css",
    "spinner.css",
    "text_defaults.css",
    "text_defaults_md.css",
    "throbber.css",
    "widgets.css",
  ]

  if (is_linux) {
    in_files += [ "roboto.css" ]
  }

  if (include_polymer) {
    in_files += [ "md_colors.css" ]
  }

  if (is_chromeos) {
    in_files += [
      "os_header.css",
      "overlay.css",
    ]
  }
}