From aa122cbae78ce97d60c0c98ba14df753d97e40b1 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 30 Jan 2022 19:06:58 +0300 Subject: style: format entire depot with nixpkgs-fmt This CL can be used to compare the style of nixpkgs-fmt against other formatters (nixpkgs, alejandra). Change-Id: I87c6abff6bcb546b02ead15ad0405f81e01b6d9e Reviewed-on: https://cl.tvl.fyi/c/depot/+/4397 Tested-by: BuildkiteCI Reviewed-by: sterni Reviewed-by: lukegb Reviewed-by: wpcarro Reviewed-by: Profpatsch Reviewed-by: kanepyork Reviewed-by: tazjin Reviewed-by: cynthia Reviewed-by: edef Reviewed-by: eta Reviewed-by: grfn --- web/tvl/logo/default.nix | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) (limited to 'web/tvl/logo/default.nix') diff --git a/web/tvl/logo/default.nix b/web/tvl/logo/default.nix index 940f67199b..d9e023946a 100644 --- a/web/tvl/logo/default.nix +++ b/web/tvl/logo/default.nix @@ -21,20 +21,22 @@ let # Create an animated CSS that equally spreads out the colours over # the animation duration (1min). - animatedCss = colours: let - # Calculate at which percentage offset each colour should appear. - stepSize = 100 / ((builtins.length colours) - 1); - frames = lib.imap0 (idx: colour: { inherit colour; at = idx * stepSize; }) colours; - frameCss = frame: "${toString frame.at}% { fill: ${frame.colour}; }"; - in '' - #armchair-background { - animation: 30s infinite alternate armchairPalette; - } + animatedCss = colours: + let + # Calculate at which percentage offset each colour should appear. + stepSize = 100 / ((builtins.length colours) - 1); + frames = lib.imap0 (idx: colour: { inherit colour; at = idx * stepSize; }) colours; + frameCss = frame: "${toString frame.at}% { fill: ${frame.colour}; }"; + in + '' + #armchair-background { + animation: 30s infinite alternate armchairPalette; + } - @keyframes armchairPalette { - ${lib.concatStringsSep "\n" (map frameCss frames)} - } - ''; + @keyframes armchairPalette { + ${lib.concatStringsSep "\n" (map frameCss frames)} + } + ''; # Dark version of the logo, suitable for light backgrounds. darkCss = armchairCss: '' @@ -67,7 +69,8 @@ let ''; -in depot.nix.readTree.drvTargets(lib.fix (self: { +in +depot.nix.readTree.drvTargets (lib.fix (self: { # Expose the logo construction functions. inherit palette darkCss lightCss animatedCss staticCss; @@ -75,7 +78,7 @@ in depot.nix.readTree.drvTargets(lib.fix (self: { logoSvg = style: pkgs.writeText "logo.svg" (logoSvg style); # Create a PNG of the TVL logo with the specified style and DPI. - logoPng = style: dpi: pkgs.runCommandNoCC "logo.png" {} '' + logoPng = style: dpi: pkgs.runCommandNoCC "logo.png" { } '' ${pkgs.inkscape}/bin/inkscape \ --export-area-drawing \ --export-background-opacity 0 \ @@ -87,7 +90,8 @@ in depot.nix.readTree.drvTargets(lib.fix (self: { pastelRainbow = self.logoSvg (darkCss (animatedCss (lib.attrValues palette))); } -# Add individual outputs for static dark logos of each colour. -// (lib.mapAttrs' - (k: v: lib.nameValuePair "${k}Png" - (self.logoPng (darkCss (staticCss v)) 96)) palette))) + # Add individual outputs for static dark logos of each colour. + // (lib.mapAttrs' + (k: v: lib.nameValuePair "${k}Png" + (self.logoPng (darkCss (staticCss v)) 96)) + palette))) -- cgit 1.4.1