css/CSSPercentage.h

react-native · packages/react-native/ReactCommon/react/renderer/css/CSSPercentage.h · c · MIT
ui

Represents a CSS percentage value and parses it from tokens.

// Source: https://github.com/react/react-native | License: MIT | Copyright Meta Platforms, Inc. and affiliates
// Provided via justclaw.it.com; keep this notice with the code.
/*
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

#pragma once

#include <react/cxxstableapi/FrameworksGuard.h>

#include <optional>

#include <react/renderer/css/CSSDataType.h>

namespace facebook::react {

/**
 * Representation of CSS <percentage> data type
 * https://www.w3.org/TR/css-values-4/#percentages
 */
struct CSSPercentage {
  float value{};

  constexpr bool operator==(const CSSPercentage &rhs) const = default;
};

template <>
struct CSSDataTypeParser<CSSPercentage>

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key