ladybird/Userland/Libraries/LibWeb/CSS/StyleValues/PlaceItemsStyleValue.cpp
Aliaksandr Kalenik c72a2f9e46 LibWeb/CSS: Serialize short version if possible for "place-" properties
Output short version when both parts of place-content, place-items,
place-self are the same.
2023-08-06 08:26:36 +02:00

20 lines
541 B
C++

/*
* Copyright (c) 2023, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "PlaceItemsStyleValue.h"
namespace Web::CSS {
ErrorOr<String> PlaceItemsStyleValue::to_string() const
{
auto align_items = TRY(m_properties.align_items->to_string());
auto justify_items = TRY(m_properties.justify_items->to_string());
if (align_items == justify_items)
return String::formatted("{}", align_items);
return String::formatted("{} {}", align_items, justify_items);
}
}