1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5 use style_traits::{CssWriter, ToCss};
6 use values::specified::{BorderStyle, Color};
7 use std::fmt::{self, Write};
8
serialize_directional_border<W, I,>( dest: &mut CssWriter<W>, width: &I, style: &BorderStyle, color: &Color, ) -> fmt::Result where W: Write, I: ToCss,9 fn serialize_directional_border<W, I,>(
10 dest: &mut CssWriter<W>,
11 width: &I,
12 style: &BorderStyle,
13 color: &Color,
14 ) -> fmt::Result
15 where
16 W: Write,
17 I: ToCss,
18 {
19 width.to_css(dest)?;
20 dest.write_str(" ")?;
21 style.to_css(dest)?;
22 if *color != Color::CurrentColor {
23 dest.write_str(" ")?;
24 color.to_css(dest)?;
25 }
26 Ok(())
27 }
28