PropertyName.h 505 B

123456789101112131415161718192021
  1. /*
  2. * Copyright (c) 2024, Sam Atkins <sam@ladybird.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/StringView.h>
  8. #include <LibWeb/CSS/PropertyID.h>
  9. namespace Web::CSS {
  10. // https://drafts.css-houdini.org/css-typed-om-1/#custom-property-name-string
  11. static bool is_a_custom_property_name_string(StringView string)
  12. {
  13. // A string is a custom property name string if it starts with two dashes (U+002D HYPHEN-MINUS), like --foo.
  14. return string.starts_with("--"sv);
  15. }
  16. }