{"id":23248892,"url":"https://github.com/sinhapaurush/yugalmods","last_synced_at":"2025-10-27T14:24:32.756Z","repository":{"id":186002547,"uuid":"674452323","full_name":"sinhapaurush/yugalmods","owner":"sinhapaurush","description":null,"archived":false,"fork":false,"pushed_at":"2023-08-04T02:31:54.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-12T07:25:44.913Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sinhapaurush.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-08-04T01:49:50.000Z","updated_at":"2023-08-04T01:58:20.000Z","dependencies_parsed_at":"2023-12-04T18:09:01.785Z","dependency_job_id":null,"html_url":"https://github.com/sinhapaurush/yugalmods","commit_stats":null,"previous_names":["sinhapaurush/yugalmods","fuhrerindia/yugalmods"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinhapaurush%2Fyugalmods","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinhapaurush%2Fyugalmods/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinhapaurush%2Fyugalmods/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinhapaurush%2Fyugalmods/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sinhapaurush","download_url":"https://codeload.github.com/sinhapaurush/yugalmods/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247421111,"owners_count":20936234,"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":[],"created_at":"2024-12-19T08:16:05.967Z","updated_at":"2025-10-27T14:24:32.630Z","avatar_url":"https://github.com/sinhapaurush.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yugalmods\nThis library is successor of Yugal's main module file, extra methods for styles and other miscellaneous functions are removed from built-in `yugal.js` file in `modules/` directory, hence to use them, you need to install this library.\n## Installation\n```bash\nyugal --install https://github.com/sinhapaurush/yugalmods.git\n```\n## yugal.include(filepath);\nAdds external JavaScript to `\u003cbody\u003e` script added by this method can not undone. This can not be undone. Accepts one argument as JS path in string.\n## yugal.files(arrayofpaths);\nThis function accepts array of paths of JS files which you want to add into the `\u003cbody\u003e`. It is similar to `yugal.include` but can add multiple files at once.\n## yugal.style(cssobject);\nAccepts a JS object which contains CSS Style and converts it to valid CSS string.\nExample\n```js\n    const css = {\n    fontSize: 10,\n    color: \"#000000\",\n    background: \"red\"\n    };\n    console.log(yugal.style(css));\n    //Returns \"font-size:10px;color:#000000;background:red;\"\n```\n_Property name in css object should be in camel casing_\n## yugal.css(css_style, element);\nThis function accepts CSS Style in first parameter and the target element in second parameter. CSS Style can JS Object or CSS String both.\n```js\nconst some_style = {\ncolor:\"red\",\nfontSize:20\n};\nyugal.css(some_style, \"#thisdiv\"); //#thisdiv is used to target an element with 'thisdiv' id. Its rule is same as CSS.\n//ABOVE IS VALID STRING\n\nconst another_style = \"color:red;font-size:20px\";\nyugal.css(another_style, \"#thisdiv\"); //THIS IS ALSO VALID\n```\n## yugal.StyleSheet\nThis is a set of functions related to styles.\n### yugal.StyleSheet.create(object, target_type);\nAccepts CSS object in first parameter. It should be collection of objects in one parent object with keys as target elements. Second parameted is optional, but accepts a string if provided then it will change target type among class, id and tags. This function returns CSS string, which can be furter used in `yugal.StyleSheet.inject` or equivalent functions.\n```js\nyugal.StyleSheet.create({\nmydiv: {color:\"#000\", textDecoration: 'none'},\nabc: {fontSize:30}\n}, \"#\"); \n//This will apply respective css property to id mydiv and abc. Instead of\n// '#' use '.' for class and leave blank for  tags. \n```\n### yugal.StyleSheet.inject(css_string);\nAccepts css design string and inject it to DOM.\n```js\na = \"h1{font-size:40px;}\";\nyugal.StyleSheet.inject(a);\n```\n### yugal.StyleSheet.import(css_file_path, id)\nThis function will accept first parameter as file path to external CSS file and second parameter as id to be parsed to the \u003clink\u003e tag generated. It also returns generated tags.\n```js\na = yugal.StyleSheet.import('abc.css', 'thistag');\n```\nAbove code will inject HTML below to `\u003chead\u003e`\n```html\n\u003clink rel=\"stylesheet\" type=\"text/css\" href=\"abc.css\" id=\"thistag\" /\u003e\n```\nYou can manipulate it as below\n```js\na.setAttribute(\"href\", \"def.css\");\na.remove();\n// variable `a` is defined above \n```\nWhen this function is called, whole `\u003chead\u003e` tag is rebuilt, resulting in loading `\u003chead\u003e` contents like loaded files again. So use of this function should be limited. Use this function wisely.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinhapaurush%2Fyugalmods","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsinhapaurush%2Fyugalmods","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinhapaurush%2Fyugalmods/lists"}