Commit Graph

  • 72ae82b6c5 Create test for interchangable - _ in builtins ConnorSkees 2020-02-15 11:47:37 -05:00
  • 2a6bb7d24f Lowercase github name ConnorSkees 2020-02-15 11:47:19 -05:00
  • 98b14e010e Bump version to 0.2.0 ConnorSkees 2020-02-15 10:12:32 -05:00
  • 03c278ed19 exclude tests from crates.io ConnorSkees 2020-02-15 10:11:26 -05:00
  • e02c0ae574 2020-02-15 tests ConnorSkees 2020-02-15 10:06:26 -05:00
  • 48e618c43d Don't print out styles if they are null ConnorSkees 2020-02-15 09:58:41 -05:00
  • 8f379c425d Add tests for str-length() ConnorSkees 2020-02-15 09:45:43 -05:00
  • 19d68c3c5d Handle str-slice $end-at is 0 ConnorSkees 2020-02-15 08:54:10 -05:00
  • d082583917 Handle negative numbers in str-slice() ConnorSkees 2020-02-15 08:51:00 -05:00
  • fab55c5105 Properly handle str-slice() when $start-at is 0 ConnorSkees 2020-02-15 08:32:46 -05:00
  • 35ed667f16 Implement builtin function comparable() ConnorSkees 2020-02-15 08:16:17 -05:00
  • 3823a0f9cd Use same implementation for rgb() and rgba() ConnorSkees 2020-02-15 07:06:45 -05:00
  • 4702461fe7 Allow 3 arguments in rgba() ConnorSkees 2020-02-15 07:00:24 -05:00
  • 46e4ccd5f9 Allow alpha in hsl() ConnorSkees 2020-02-15 06:55:20 -05:00
  • a35fa119e0 Implement builtin function ie-hex-str() ConnorSkees 2020-02-14 20:32:25 -05:00
  • 19f59efd98 Handle alpha over 1 (a little bit) ConnorSkees 2020-02-14 20:13:58 -05:00
  • bb7e47a4fb Implement builtin function scale-color() ConnorSkees 2020-02-14 19:51:24 -05:00
  • e2d1adf8b9 Implement builtin function adjust-color() ConnorSkees 2020-02-14 19:29:50 -05:00
  • 6369282044 Refactor change-color to reduce boilerplate ConnorSkees 2020-02-14 19:21:24 -05:00
  • 7811a3e056 function-exists searches builtin functions and ignores quotes ConnorSkees 2020-02-14 18:39:50 -05:00
  • c16d6fed4e clippy ConnorSkees 2020-02-14 18:28:09 -05:00
  • ae9b97a6b2 Properly handle hue values above and below maximum ConnorSkees 2020-02-14 18:00:16 -05:00
  • 4303bd451c Handle negative hues ConnorSkees 2020-02-14 17:52:25 -05:00
  • a328617001 Implement builtin function change-color() ConnorSkees 2020-02-14 17:38:10 -05:00
  • af95658953 Implement builtin function mix() ConnorSkees 2020-02-14 16:47:23 -05:00
  • c04f83ddcf Refactor Color functions into multiple impl blocks ConnorSkees 2020-02-14 15:22:39 -05:00
  • 8f63694ffd Refactor color functions into separate modules ConnorSkees 2020-02-14 15:08:41 -05:00
  • dafd1f3e0d Refactor internal printing of StyleSheet ConnorSkees 2020-02-14 14:55:21 -05:00
  • f6f4eb3e15 Cleanup example code for StyleSheet::print_as_css() ConnorSkees 2020-02-14 14:36:16 -05:00
  • 6c97cd4755 Implement builtin function str-slice() ConnorSkees 2020-02-14 14:23:54 -05:00
  • c95ecc0825 Fix crash encountering -- ConnorSkees 2020-02-14 13:27:08 -05:00
  • 3af2292d5b Implement builtin function complement() ConnorSkees 2020-02-14 12:56:28 -05:00
  • 7f17139a3b Refactor HSL functions into separate module ConnorSkees 2020-02-14 12:43:12 -05:00
  • f7351e1458 Implement builtin function abs() ConnorSkees 2020-02-14 12:30:48 -05:00
  • af8bd516b2 Implement builtin function grayscale() ConnorSkees 2020-02-14 12:11:08 -05:00
  • 08bfa8f145 Implement one and two args for rgba() ConnorSkees 2020-02-14 11:52:31 -05:00
  • a2ddc8016f Implement builtin functions fade-in(), fade-out(), opacify(), and transparentize() ConnorSkees 2020-02-14 11:10:25 -05:00
  • 089436ec9d Revert "Allow unquote on all values" ConnorSkees 2020-02-14 10:18:48 -05:00
  • a7322e1ee8 Allow numbers in selectors ConnorSkees 2020-02-14 10:11:40 -05:00
  • f4c5fbae27 Allow unquote on all values ConnorSkees 2020-02-14 10:11:26 -05:00
  • b31c9587bc Implement builtin function length() ConnorSkees 2020-02-14 10:10:51 -05:00
  • 38802b69c5 Fix hue algorithm when red == blue and red > green ConnorSkees 2020-02-14 09:46:50 -05:00
  • 65c5c209f3 Implement Rem and RemAssign for Number ConnorSkees 2020-02-14 09:44:46 -05:00
  • 201f97a914 Fix how hue is calculated when color channels are equal ConnorSkees 2020-02-14 09:37:05 -05:00
  • be84350d19 Implement builtin functions saturate() and desaturate() ConnorSkees 2020-02-14 09:05:57 -05:00
  • c7c1ad5fe5 Implement builtin function darken() ConnorSkees 2020-02-14 08:54:43 -05:00
  • db8e8eaebb Implement builtin function lighten() ConnorSkees 2020-02-14 08:43:10 -05:00
  • 6427a7ab81 Implement builtin function adjust-hue ConnorSkees 2020-02-14 08:14:30 -05:00
  • f8a09bec6e Initial implementation of Div for Value::Dimension ConnorSkees 2020-02-14 08:13:09 -05:00
  • 496c0740f2 Remove redundant clone before Value::eval() ConnorSkees 2020-02-14 07:51:36 -05:00
  • fdba87334b 2020-02-09 tests ConnorSkees 2020-02-09 22:48:55 -05:00
  • 4c70b84ed7 Calls to undefined functions should be treated as idents ConnorSkees 2020-02-09 20:26:14 -05:00
  • e37179cfd7 Properly handle precision ConnorSkees 2020-02-09 20:00:35 -05:00
  • 589ebce452 Allow for unknown at-rules ConnorSkees 2020-02-09 19:44:45 -05:00
  • 7fcfeee97e clippy ConnorSkees 2020-02-09 19:07:44 -05:00
  • f6b27177ba Use Number as to represent color channels so precision is not lost ConnorSkees 2020-02-09 18:53:48 -05:00
  • 0ec2c46744 rustfmt ConnorSkees 2020-02-09 18:28:24 -05:00
  • 40e1e554c7 Implement builtin functions ceil() and floor() ConnorSkees 2020-02-09 16:14:24 -05:00
  • 116bb43bd5 Implement builtin function round() ConnorSkees 2020-02-09 16:10:32 -05:00
  • 405a1c2d42 Implement mul and div for Value and builtin function percentage() ConnorSkees 2020-02-09 16:05:07 -05:00
  • c7f1941823 Boilerplate for builtin function call() ConnorSkees 2020-02-09 15:36:30 -05:00
  • b8d8824db9 Lex and parse negative numbers ConnorSkees 2020-02-09 15:08:23 -05:00
  • 2f54de15c5 Allow optional alpha argument in rgb() ConnorSkees 2020-02-09 15:07:29 -05:00
  • d6ed0391db Handle function calls in call args ConnorSkees 2020-02-09 14:27:54 -05:00
  • bc0c1d35f6 Clamp values passed to from_hsla() ConnorSkees 2020-02-09 14:24:27 -05:00
  • d14ac11396 Implement weight for invert() ConnorSkees 2020-02-09 13:44:27 -05:00
  • 1269c9f662 Initial implementation of invert() (no support for weight argument) ConnorSkees 2020-02-09 13:31:58 -05:00
  • 8638e2f251 Implement builtin functions hue(), saturation(), and lightness() ConnorSkees 2020-02-09 12:18:41 -05:00
  • 835fe61bb4 Implement subtraction for colors ConnorSkees 2020-02-09 11:07:13 -05:00
  • e282220f8c Refactor how color repr is created ConnorSkees 2020-02-09 10:56:45 -05:00
  • 2b3d8fcce7 Implement addition between colors and idents ConnorSkees 2020-02-09 10:49:37 -05:00
  • 901c911b5b Handle percentages and large/small values inside rgb() and rgba() ConnorSkees 2020-02-09 10:41:05 -05:00
  • 3d0d37bf2d Convert colors resulting from functions to named colors when applicable ConnorSkees 2020-02-09 03:43:46 -05:00
  • f3e0638329 Allow hue to be in degrees ConnorSkees 2020-02-09 03:21:15 -05:00
  • 5cab99cd6e Implement hsl() and hsla() functions ConnorSkees 2020-02-09 03:13:31 -05:00
  • 86173a3ca7 Implement builtin functions quote and unquote ConnorSkees 2020-02-08 21:19:54 -05:00
  • 22670a7e4b Implement builtin function str-length ConnorSkees 2020-02-08 20:38:37 -05:00
  • 07845beee9 Implement to-upper-case() and to-lower-case() ConnorSkees 2020-02-08 20:32:10 -05:00
  • 6c8dd6de93 rustfmt ConnorSkees 2020-02-08 20:20:03 -05:00
  • c75e5cc553 Properly parse floating point numbers and rgba() ConnorSkees 2020-02-08 20:07:20 -05:00
  • 2a6ec38fd4 Special case builtin function opacity(number) ConnorSkees 2020-02-08 18:55:48 -05:00
  • bf98382b0b Improve alpha/opacity function tests ConnorSkees 2020-02-08 18:51:29 -05:00
  • 44d257494a Properly print decimal numbers ConnorSkees 2020-02-08 18:43:18 -05:00
  • 04d2c4ab74 Implement built in functions opacity and alpha ConnorSkees 2020-02-08 17:49:23 -05:00
  • 4585558266 Add (variable|function|mixin)-exists builtin functions ConnorSkees 2020-02-08 17:41:54 -05:00
  • cbec684052 Test for hyphen/dash interchangable and number after interpolation ConnorSkees 2020-02-08 17:33:52 -05:00
  • fa582b3316 Treat - and _ as the same in identifiers ConnorSkees 2020-02-08 17:26:01 -05:00
  • 783e43b765 clippy ConnorSkees 2020-02-08 17:03:43 -05:00
  • 705ae0c810 Refactor how idents are flattened ConnorSkees 2020-02-08 16:49:44 -05:00
  • 3404073ed8 Refactor hex parsing ConnorSkees 2020-02-08 16:44:42 -05:00
  • a139e07189 Move Value parsing to separate file ConnorSkees 2020-02-08 16:17:58 -05:00
  • 55ca402644 rustfmt ConnorSkees 2020-02-08 16:08:35 -05:00
  • 6471ce8f29 Refactor value ConnorSkees 2020-02-08 16:07:37 -05:00
  • 789c55ac3d Refactor Value::is_true() ConnorSkees 2020-02-08 16:01:21 -05:00
  • 29917d95d4 Handle == and != ConnorSkees 2020-02-08 15:53:49 -05:00
  • 74a81060ba Remove Color tokenkind ConnorSkees 2020-02-08 13:16:53 -05:00
  • b2f7b57e6b Add num-rational and num-bigint as dependencies ConnorSkees 2020-02-08 09:39:19 -05:00
  • 8b882bc5dc Remove unused dimension struct ConnorSkees 2020-02-08 09:38:42 -05:00
  • 08ca3f6d01 Initial implementation of rgb() function ConnorSkees 2020-02-08 09:37:48 -05:00
  • c5bc6062a0 Implement basic color parsing ConnorSkees 2020-02-08 08:48:31 -05:00