{"id":17297376,"url":"https://github.com/jackmcpickle/sass-fractions","last_synced_at":"2025-04-14T12:22:07.148Z","repository":{"id":23200018,"uuid":"98408202","full_name":"jackmcpickle/sass-fractions","owner":"jackmcpickle","description":"converts numbered fractions into words or lowest common denominator","archived":false,"fork":false,"pushed_at":"2024-12-13T04:05:30.000Z","size":596,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-28T18:02:43.145Z","etag":null,"topics":["fractions","function","sass"],"latest_commit_sha":null,"homepage":"","language":"SCSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jackmcpickle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-26T09:56:29.000Z","updated_at":"2024-12-13T04:05:34.000Z","dependencies_parsed_at":"2023-10-12T16:50:39.413Z","dependency_job_id":"2ab02a53-1b29-4030-aa82-e944dcc2069e","html_url":"https://github.com/jackmcpickle/sass-fractions","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackmcpickle%2Fsass-fractions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackmcpickle%2Fsass-fractions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackmcpickle%2Fsass-fractions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackmcpickle%2Fsass-fractions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jackmcpickle","download_url":"https://codeload.github.com/jackmcpickle/sass-fractions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248877970,"owners_count":21176244,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fractions","function","sass"],"created_at":"2024-10-15T11:15:44.411Z","updated_at":"2025-04-14T12:22:07.070Z","avatar_url":"https://github.com/jackmcpickle.png","language":"SCSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sass Fractions\n\n[![Build Status](https://travis-ci.org/jackmcpickle/sass-fractions.svg?branch=master)](https://travis-ci.org/jackmcpickle/sass-fractions)\n\nConverts fractions to words or lowest common denominator\n\n## Install\n\n`npm install sass-fractions`\n\nor\n\n`yarn add sass-fractions`\n\n## Function - wfrac()\n\n`wfrac($numerator, $denominator, $separator: '-', $lowest-common-denominator: true)`\n\nReturns the fraction passed into words\n\n`$separator` -  character(s) to separate the worded fraction, default: '-'\n\n`$lowest-common-denominator` - Whether or not to convert the fraction into it's lowest common denominator, default: true\n\n### Usage - fraction to words as lowest common denominator\n\nCreate a simple grid\n\n```scss\n.grid-#{wfrac(2, 3)} {\n  /* properties... */\n}\n```\nOutputs\n\n```css\n.grid-two-thirds {\n  /* properties... */\n}\n```\n\n### Usage - fractions to words without converting\n\n```scss\n$lowest-common-denominator: false;\n.grid-#{wfrac(4, 12, '_')} {\n  /* properties... */\n}\n```\n\nOutputs\n\n```css\n.grid_four_twelfths {\n  /* properties... */\n}\n```\n\n## Function - lfrac()\n\n`lfrac($numerator, $denominator, $separator: '-')`\n\nReturns the fraction passed into it's lowest common denominator.\n\n`$separator` -  character(s) to separate the fraction words, default: '-'\n\n\n### Usage - fraction to lowest common denominator\n\n```scss\n.grid-#{lfrac(5, 10)} {\n  /* properties... */\n}\n```\n\nOutputs \n\n```css\n.grid-1-2 {\n  /* properties... */\n}\n```\n\n## Multilingual\n\nChange the default `$single-fraction-names` and `$digit-names`\n\n```scss\n// Spanish / Español\n$single-fraction-names: (todo, mitad, tercio);\n$digit-names: (uno, dos);\n\n.grid-#{wfrac(2, 3)} {\n  /* properties... */\n}\n\n```\n\nOutputs\n\n```css\n.grid-dos-tercios {\n  /* properties... */\n}\n```\n\n## Function - frac2word()\n\n`frac2word($string, $separator: '/', $fraction-separator: '-', $lowest-common-denominator: true)`\n\nParses the fraction as a string - returns the fraction passed into words.\n\n`$separator` -  character(s) that is used to separate the fraction string, default: '/'\n\n`$fraction-separator` - character(s) to separate the fraction words that are returned.\n\n`$lowest-common-denominator` - Whether or not to convert the fraction into it's lowest common denominator, default: true\n\n```scss\n.grid-#{frac2word('2/12')} {\n  /* properties... */\n}\n```\n\nOutputs\n\n```css\n.grid-one-sixth {\n  /* properties... */\n}\n```\n\n## Function - frac2low()\n\n`frac2low($string, $separator: '/', $fraction-separator: '-')`\n\nParses the fraction as a string - returns the fraction in its lowest common denominator form\n\n`$separator` -  character(s) that is used to separate the fraction string, default: '/'\n\n`$fraction-separator` - character(s) to separate the fraction words that are returned.\n\n```scss\n.grid-#{frac2low('2/12')} {\n  /* properties... */\n}\n```\n\nOutputs\n\n```css\n.grid-1-6 {\n  /* properties... */\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackmcpickle%2Fsass-fractions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjackmcpickle%2Fsass-fractions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackmcpickle%2Fsass-fractions/lists"}