diff --git a/Cabal/src/Distribution/Simple/Haddock.hs b/Cabal/src/Distribution/Simple/Haddock.hs index 01bc17828e2..ee2b88e76af 100644 --- a/Cabal/src/Distribution/Simple/Haddock.hs +++ b/Cabal/src/Distribution/Simple/Haddock.hs @@ -617,6 +617,7 @@ fromHaddockProjectFlags flags = , argInterfaces = fromFlagOrDefault [] (haddockProjectInterfaces flags) , argLinkedSource = Flag True , argResourcesDir = haddockProjectResourcesDir flags + , argCssFile = haddockProjectCss flags } fromPackageDescription :: HaddockTarget -> PackageDescription -> HaddockArgs diff --git a/cabal-install/src/Distribution/Client/CmdHaddock.hs b/cabal-install/src/Distribution/Client/CmdHaddock.hs index 8ecc5487798..677589e3e35 100644 --- a/cabal-install/src/Distribution/Client/CmdHaddock.hs +++ b/cabal-install/src/Distribution/Client/CmdHaddock.hs @@ -136,7 +136,8 @@ mkFlagsAbsolute :: NixStyleFlags ClientHaddockFlags -> IO (NixStyleFlags ClientH mkFlagsAbsolute relFlags = do let relHaddockFlags = haddockFlags relFlags absHaddockOutputDir <- traverse makeAbsolute (haddockOutputDir relHaddockFlags) - return (relFlags{haddockFlags = relHaddockFlags{haddockOutputDir = absHaddockOutputDir}}) + absHaddockCss <- traverse makeAbsolute (haddockCss relHaddockFlags) + return (relFlags{haddockFlags = relHaddockFlags{haddockOutputDir = absHaddockOutputDir, haddockCss = absHaddockCss}}) -- | The @haddock@ command is TODO. -- diff --git a/changelog.d/pr-10637 b/changelog.d/pr-10637 new file mode 100644 index 00000000000..0cff281a4d0 --- /dev/null +++ b/changelog.d/pr-10637 @@ -0,0 +1,11 @@ +--- +synopsis: Fix Haddock CSS handling in multi-package projects +packages: [cabal-install, Cabal] +prs: 10637 +issues: [10636] +--- + +When `--css=` flag is provided to `cabal haddock-project`: + +- the Haddock index is now properly styled by the provided CSS file +- each package in the project now has their docs properly styled by the provided CSS file