{"action":"closed","issue":{"url":"https://api.github.com/repos/handsontable/handsontable/issues/3406","repository_url":"https://api.github.com/repos/handsontable/handsontable","labels_url":"https://api.github.com/repos/handsontable/handsontable/issues/3406/labels{/name}","comments_url":"https://api.github.com/repos/handsontable/handsontable/issues/3406/comments","events_url":"https://api.github.com/repos/handsontable/handsontable/issues/3406/events","html_url":"https://github.com/handsontable/handsontable/issues/3406","id":148756747,"number":3406,"title":"Unnecessary charset declaration in `handsontable.full.css`","user":{"login":"wspurgin","id":3472781,"avatar_url":"https://avatars.githubusercontent.com/u/3472781?v=3","gravatar_id":"","url":"https://api.github.com/users/wspurgin","html_url":"https://github.com/wspurgin","followers_url":"https://api.github.com/users/wspurgin/followers","following_url":"https://api.github.com/users/wspurgin/following{/other_user}","gists_url":"https://api.github.com/users/wspurgin/gists{/gist_id}","starred_url":"https://api.github.com/users/wspurgin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wspurgin/subscriptions","organizations_url":"https://api.github.com/users/wspurgin/orgs","repos_url":"https://api.github.com/users/wspurgin/repos","events_url":"https://api.github.com/users/wspurgin/events{/privacy}","received_events_url":"https://api.github.com/users/wspurgin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/handsontable/handsontable/labels/Core:%20handsontable","name":"Core: handsontable","color":"009800"},{"url":"https://api.github.com/repos/handsontable/handsontable/labels/Improvement%20suggestion","name":"Improvement suggestion","color":"0052cc"},{"url":"https://api.github.com/repos/handsontable/handsontable/labels/Priority:%20normal","name":"Priority: normal","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-04-15T20:11:23Z","updated_at":"2016-06-28T13:38:45Z","closed_at":"2016-06-28T13:38:45Z","body":"In version 0.24.2 (and since version 0.15.0-beta1), the charset declaration in the Pickaday plugin \r\nhas existed. As @splitbrain pointed out in #2843, this is an unnecessary declaration as the default charset is UTF-8.\r\n\r\n#2843 was opened in September of 2015, but no action was taken because no actual *problem* was ever reported due to the charset. Here I'll explain my use case where it **is** a problem to have this charset declaration.\r\n\r\nNormally, Handson table css is imported at a the root level (like other external sass/css) like so:\r\n\r\n```sass\r\n// application.sass\r\n@import handsontable.full\r\n\r\n.custom-style\r\n  ...\r\n```\r\n\r\nThe charset declaration, however, **must** appear at the root level. In the above use case, because of where the `@import` appears, it *does* appear at the root level.\r\n\r\n## My use case\r\n\r\nI have an app that uses a few other frameworks in conjunction with Handson table. These other frameworks have styles that can conflict with Handson table. As such, I've typically imported Handson table under a specific containing class like so:\r\n\r\n```sass\r\nbody.handson-table-enabled\r\n  @import \"handsontable.full\"\r\n...\r\n```\r\n\r\nIn this way, the \"selector specificity\" of Handson table styles will take precedence\\*. However, due to the charset declaration, the above import will produce an error (because the declaration will no longer be at the root level). While it could be argued that this approach is hackish to start with, I'd argue that using non-specific HTML tags instead of specific classes as part of styles is \"lazy\" to start with, but everybody does it anyway.... likewise, in every app I've ever worked on where there were multiple frameworks with multiple styles, this approach was used to increase the precedence of specific frameworks' styles.\r\n\r\nSince the charset declaration is declaring the default charset anyway, it's superfluous. The only way I've solved this issue is by removing the charset declaration. You can always add a note in the readme instructions for anybody whose using something other than charset UTF-8 for stylesheets that UTF-8 charset is required.... though I've never encountered that myself.\r\n\r\n\\* This is not universally true, but in situations where styles reference HTML tags (like `th` or `.some-class table th` for instance) this method usually increase those styles' specificity enough to take precedence."}}
{"actor":{"display_login":"AMBudnik"}}