Skip to content

Commit

Permalink
SpaicCSS 모듈 코드 정리
Browse files Browse the repository at this point in the history
  • Loading branch information
kmc7468 committed Mar 17, 2020
1 parent 0f12eac commit c7c60c8
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 9 deletions.
4 changes: 2 additions & 2 deletions include/spaic-css/CSS.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
namespace spaic::css
{
template <typename... T>
Stylesheet css(T... params);
Stylesheet css(T&&... params);
template <typename... T>
Stylesheet keyframes(T... params);
Stylesheet keyframes(T&&... params);
} // namespace spaic::css

#include <spaic-css/detail/CSS.hpp>
3 changes: 2 additions & 1 deletion include/spaic-css/CssProperty.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ template <typename T>
class CssProperty
{
public:
AssignedCssProperty<T> operator=(T value);
template <typename U>
AssignedCssProperty<T> operator=(U&& value);
};
} // namespace spaic::css::prop

Expand Down
6 changes: 4 additions & 2 deletions include/spaic-css/Unit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class CssUnit
long double value;

public:
CssUnit(long double value) noexcept : value(value) {}
CssUnit(long double value) noexcept;

std::string toCssValue();
};
Expand Down Expand Up @@ -99,4 +99,6 @@ defineUnitUDL(percent);
} // namespace spaic::css::unit

#undef defineUnitUDLRaw
#undef defineUnitUDL
#undef defineUnitUDL

#include <spaic-css/detail/Unit.hpp>
8 changes: 7 additions & 1 deletion include/spaic-css/detail/CSS.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@
namespace spaic::css
{
template <typename... T>
Stylesheet css(T... params)
Stylesheet css(T&&... params)
{
// TODO: css(params)
return Stylesheet();
}
template<typename ...T>
Stylesheet keyframes(T&&... params)
{
// TODO: keyframes(params)
return Stylesheet();
}
} // namespace spaic::css
5 changes: 2 additions & 3 deletions include/spaic-css/detail/CssProperty.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@

namespace spaic::css::prop
{

template <typename T>
AssignedCssProperty<T> CssProperty<T>::operator=(T value)
template <typename U>
AssignedCssProperty<T> CssProperty<T>::operator=(U&& value)
{
return AssignedCssProperty<T>();
}

} // namespace spaic::css::prop
9 changes: 9 additions & 0 deletions include/spaic-css/detail/Unit.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#pragma once

#include <spaic-css/Unit.hpp>

namespace spaic::css::unit
{
template <CssUnitType T>
CssUnit<T>::CssUnit(long double value) noexcept : value(value) {}
} // namespace spaic::css::unit

0 comments on commit c7c60c8

Please sign in to comment.