% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/wb_styles.R
\name{create_dxfs_style}
\alias{create_dxfs_style}
\title{Create a custom formatting style}
\usage{
create_dxfs_style(
  font_name = NULL,
  font_size = NULL,
  font_color = NULL,
  num_fmt = NULL,
  format_code = NULL,
  border = NULL,
  border_color = wb_color(getOption("openxlsx2.borderColor", "black")),
  border_style = getOption("openxlsx2.borderStyle", "thin"),
  bg_fill = NULL,
  fg_color = NULL,
  gradient_fill = NULL,
  text_bold = NULL,
  text_strike = NULL,
  text_italic = NULL,
  text_underline = NULL,
  ...
)
}
\arguments{
\item{font_name}{A name of a font. Note the font name is not validated.
If \code{font_name} is \code{NULL}, the workbook \code{base_font} is used. (Defaults to Calibri), see \code{\link[=wb_get_base_font]{wb_get_base_font()}}}

\item{font_size}{Font size. A numeric greater than 0.
By default, the workbook base font size is used. (Defaults to 11)}

\item{font_color}{Color of text in cell.  A valid hex color beginning with "#"
or one of colors(). If \code{font_color} is NULL, the workbook base font colors is used.
(Defaults to black)}

\item{num_fmt}{Cell formatting. Previously this was a format code. To be backwards compatible, this still allows for a code}

\item{format_code}{A custom format code}

\item{border}{\code{NULL} or \code{TRUE}}

\item{border_color}{"black"}

\item{border_style}{"thin"}

\item{bg_fill}{Cell background fill color.}

\item{fg_color}{Cell foreground fill color.}

\item{gradient_fill}{An xml string beginning with \verb{<gradientFill>} ...}

\item{text_bold}{bold}

\item{text_strike}{strikeout}

\item{text_italic}{italic}

\item{text_underline}{underline 1, true, single or double}

\item{...}{Additional arguments}
}
\value{
A dxfs style node
}
\description{
Create a new style to apply to worksheet cells. These styles are used in conditional formatting and in (pivot) table styles.
}
\details{
It is possible to override border_color and border_style with \{left, right, top, bottom\}_color, \{left, right, top, bottom\}_style.
}
\examples{
# do not apply anything
style1 <- create_dxfs_style()

# change font color and background color
style2 <- create_dxfs_style(
  font_color = wb_color(hex = "FF9C0006"),
  bg_fill = wb_color(hex = "FFFFC7CE")
)

# change font (type, size and color) and background
# the old default in openxlsx and openxlsx2 <= 0.3
style3 <- create_dxfs_style(
  font_name = "Aptos Narrow",
  font_size = 11,
  font_color = wb_color(hex = "FF9C0006"),
  bg_fill = wb_color(hex = "FFFFC7CE")
)

## See package vignettes for further examples
}
\seealso{
\code{\link[=wb_add_style]{wb_add_style()}} \code{\link[=wb_add_dxfs_style]{wb_add_dxfs_style()}}

Other style creating functions: 
\code{\link{create_border}()},
\code{\link{create_cell_style}()},
\code{\link{create_colors_xml}()},
\code{\link{create_fill}()},
\code{\link{create_font}()},
\code{\link{create_numfmt}()},
\code{\link{create_tablestyle}()}
}
\concept{style creating functions}
