{"id":19403236,"url":"https://github.com/leojonathanoh/validate-css-bracers","last_synced_at":"2025-02-25T00:25:36.043Z","repository":{"id":94723384,"uuid":"121407295","full_name":"leojonathanoh/Validate-CSS-Bracers","owner":"leojonathanoh","description":"A Powershell module to help locate any unmatching bracers in a .css file/string.","archived":false,"fork":false,"pushed_at":"2018-02-25T04:20:01.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-07T12:31:42.494Z","etag":null,"topics":["bracers","module","powershell","script","validation","webdevelopment"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leojonathanoh.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":"2018-02-13T16:36:47.000Z","updated_at":"2019-10-12T07:29:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"f7d63c2a-aa3a-48e1-b448-89b0eb1942bb","html_url":"https://github.com/leojonathanoh/Validate-CSS-Bracers","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leojonathanoh%2FValidate-CSS-Bracers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leojonathanoh%2FValidate-CSS-Bracers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leojonathanoh%2FValidate-CSS-Bracers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leojonathanoh%2FValidate-CSS-Bracers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leojonathanoh","download_url":"https://codeload.github.com/leojonathanoh/Validate-CSS-Bracers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240578172,"owners_count":19823582,"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":["bracers","module","powershell","script","validation","webdevelopment"],"created_at":"2024-11-10T11:27:49.780Z","updated_at":"2025-02-25T00:25:36.027Z","avatar_url":"https://github.com/leojonathanoh.png","language":"PowerShell","readme":"# Validate-CSS-Bracers\nThis Powershell script helps locate any unmatching bracers in a .css file/string.\n\n## Requirements:\n- \u003ca href=\"https://github.com/PowerShell/PowerShell#get-powershell\" target=\"_blank\"\u003ePowershell v3\u003c/a\u003e\n- Windows / *nix environment\n\n## Features\n- Works for both minified and non-minified css.\n\n## How to use\n`Validate-CSS-Bracers` can be used as a *script* or a *module*.\n\n### As a Script\n\u003e This method can only check a single file at a time.\n\n1. Open the \u003ccode\u003eValidate-CSS-Bracers.ps1\u003c/code\u003e in your favourite text editor and configure scripts settings:\n\n  ```powershell\n  # Full Path to css file\n  # E.g. For *nix:\n  #   $css_file_fullpath = \"/path/to/file.css\"\n  # E.g. For Windows:\n  #   $css_file_fullpath = \"C:/path/to/file.css\"\n  $css_file_fullpath = \"\"\n\n  # Alternatively, paste the css within this here-string (i.e. @' \u003chere\u003e '@)\n  # NOTE: This section is used if $css_file_fullpath is empty\n  $css_as_string = @'\n  html {\n      font-size: 10px;\n  }\n  '@\n  ```\n\n2. Run the script:\n  - WinNT: Right click on the script in explorer and select \u003ccode\u003eRun with Powershell\u003c/code\u003e. (should be present on Windows 7 and up). Alternatively, open command prompt in the script directory, and run \u003ccode\u003ePowershell .\\Validate-CSS-Bracers.ps1\u003c/code\u003e\n  - *nix: Run \u003ccode\u003epowershell ./Validate-CSS-Bracers.ps1\u003c/code\u003e or \u003ccode\u003epwsh ./Validate-CSS-Bracers.ps1\u003c/code\u003e depending on which version of powershell you're running.\n\n### As a Module\n\u003e This method supports checking multiple css files by utilizing pipelining.\n\n1. [Install](https://msdn.microsoft.com/en-us/library/dd878350(v=vs.85).aspx) the `Validate-CSS-Bracers.psm1` module into **any** of the following directories:\n\n    *Windows*\n    ```powershell\n    %Windir%\\System32\\WindowsPowerShell\\v1.0\\Modules\n\n    %UserProfile%\\Documents\\WindowsPowerShell\\Modules\n\n    %ProgramFiles%\\WindowsPowerShell\\Modules\n    ```\n\n    **nix*\n    \u003e Note: These may vary between *nix distros. Check `$Env:PSModulePath` inside `Powershell`.\n\n    ```powershell\n    ~/.local/share/powershell/Modules\n\n    /usr/local/share/powershell/Modules\n\n    /opt/microsoft/powershell/6.0.0-rc/Modules\n    ```\n\n2. Import the module, then pipe the `.css` files into the module:\n\n    ```powershell\n    Import-Module Validate-CSS-Bracers\n\n    # You can either Pipe the file/files\n    $files | Validate-CSS-Bracers\n\n    # Or use the full Command (for single file)\n    Validate-CSS-Bracers -File $css_file_fullpath\n\n    # Or if you're using a CSS string\n    Validate-CSS-Bracers -CssAsString $css_as_string\n    ```\n\n## Command Line\n\n```powershell\nValidate-CSS-Bracers [[-File] \u003cString\u003e] [[-CssAsString] \u003cString\u003e] [[-NearLength] \u003cInt32\u003e] [\u003cCommonParameters\u003e]\n\nPARAMETERS\n    -File \u003cString\u003e\n        Full Path to css file, accepting input from the pipeline.\n\n        Required?                    false\n        Position?                    1\n        Default value\n        Accept pipeline input?       true (ByValue)\n        Accept wildcard characters?  false\n\n    -CssAsString \u003cString\u003e\n        CSS as a string.\n\n        Required?                    false\n        Position?                    2\n        Default value\n        Accept pipeline input?       false\n        Accept wildcard characters?  false\n\n    -NearLength \u003cInt32\u003e\n        Number of chars to spit out left and right of a found unmatching bracer\n\n        Required?                    false\n        Position?                    3\n        Default value                0\n        Accept pipeline input?       false\n        Accept wildcard characters?  false\n\n    \u003cCommonParameters\u003e\n        This cmdlet supports the common parameters: Verbose, Debug,\n        ErrorAction, ErrorVariable, WarningAction, WarningVariable,\n        OutBuffer, PipelineVariable, and OutVariable. For more information, see\n        about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).\n```\n\n## FAQ\n\n### WinNT\nQ: Help! I am getting an error \u003ccode\u003e'File C:\\...Validate-CSS-Bracers.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see \"get-help about_signing\" for more details.'\u003c/code\u003e\n- You need to allow the execution of unverified scripts. Open Powershell as administrator, type \u003ccode\u003eSet-ExecutionPolicy Unrestricted -Force\u003c/code\u003e and press ENTER. Try running the script again. You can easily restore the security setting back by using \u003ccode\u003eSet-ExecutionPolicy Undefined -Force\u003c/code\u003e.\n\nQ: Help! Upon running the script I am getting an error \u003ccode\u003eFile C:\\...Validate-CSS-Bracers.ps1 cannot be loaded. The file \nC:\\...\\Validate-CSS-Bracers.ps1 is not digitally signed. You cannot run \nthis script on the current system. For more information about running scripts and setting \nexecution policy, see about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170.\u003c/code\u003e\n- You need to allow the execution of unverified scripts. Open Powershell as administrator, type \u003ccode\u003eSet-ExecutionPolicy Unrestricted -Force\u003c/code\u003e and press ENTER. Try running the script again. You can easily restore the security setting back by using \u003ccode\u003eSet-ExecutionPolicy Undefined -Force\u003c/code\u003e.\n\nQ: Help! Upon running the script I am getting a warning \u003ccode\u003e'Execution Policy change. The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose you to the security risks described in the about_Execution_Policies help topic at http://go.microsoft.com/?LinkID=135170. Do you want to change the execution policy?\u003c/code\u003e\n- You need to allow the execution of unverified scripts. Type \u003ccode\u003eY\u003c/code\u003e for yes and press enter. You can easily restore the security setting back opening Powershell as administrator, and using the code \u003ccode\u003eSet-ExecutionPolicy Undefined -Force\u003c/code\u003e.\n\n### *nix\nNil\n\n## Known issues\nNil\n\n## Background:\n- Every web developer knows that when a page is suddenly broken, it's a css unmatching bracer. The cause of the problem becomes more obscure for minified css files. The script can help developers find those unmatching bracers and fix their css. It works for both minified and non-minified css.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleojonathanoh%2Fvalidate-css-bracers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleojonathanoh%2Fvalidate-css-bracers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleojonathanoh%2Fvalidate-css-bracers/lists"}