-
Notifications
You must be signed in to change notification settings - Fork 1
Chore: Add Missing raw files #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,10 +25,22 @@ export default function combineSelectors(cssClassesObj) { | |
| }) | ||
|
|
||
| if (sameProValSelectors.length > 1) { | ||
| if (!combinedCssRulesObj[sameProValSelectors.join(',')]) { | ||
| combinedCssRulesObj[sameProValSelectors.join(',')] = { [prop]: value } | ||
| // ignore selectors for combine | ||
| const ignoreSelectors = /(-webkit-)|(-moz-)|(-ms-)/ | ||
| const ignoreConcatSelectors = sameProValSelectors.filter((sel) => ignoreSelectors.test(sel)) | ||
| const validConcatSelectors = sameProValSelectors.filter((sel) => !ignoreSelectors.test(sel)) | ||
| ignoreConcatSelectors.forEach((selectr) => { | ||
| if (!combinedCssRulesObj[selectr]) { | ||
| combinedCssRulesObj[selectr] = { [prop]: value } | ||
| } else { | ||
| combinedCssRulesObj[selectr][prop] = value | ||
| } | ||
| }) | ||
|
|
||
| if (!combinedCssRulesObj[validConcatSelectors.join(',')]) { | ||
| combinedCssRulesObj[validConcatSelectors.join(',')] = { [prop]: value } | ||
| } else { | ||
| combinedCssRulesObj[sameProValSelectors.join(',')][prop] = value | ||
| combinedCssRulesObj[validConcatSelectors.join(',')][prop] = value | ||
| } | ||
|
Comment on lines
+40
to
44
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If if (validConcatSelectors.length > 0) {
const combinedSelector = validConcatSelectors.join(',');
if (!combinedCssRulesObj[combinedSelector]) {
combinedCssRulesObj[combinedSelector] = { [prop]: value };
} else {
combinedCssRulesObj[combinedSelector][prop] = value;
}
}
Comment on lines
+40
to
44
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If You should add a check to ensure if (validConcatSelectors.length > 0) {
if (!combinedCssRulesObj[validConcatSelectors.join(',')]) {
combinedCssRulesObj[validConcatSelectors.join(',')] = { [prop]: value }
} else {
combinedCssRulesObj[validConcatSelectors.join(',')][prop] = value
}
} |
||
|
|
||
| sameProValSelectors.forEach((selectr) => { | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -14,7 +14,7 @@ export default function optimizeAndDefineCssClassProps(selectorObj, cssVarDefina | |||||
| for (let i = 0; i < selectorsCount; i += 1) { | ||||||
| const selector = selectors[i] | ||||||
| if (Object.hasOwnProperty.call(selectorsObj, selector)) { | ||||||
| const declaration = selectorsObj[selector] | ||||||
| const declaration = selectorsObj[selector] || {} | ||||||
| const newSelectors = normalizeSelector(selector).split(',') | ||||||
| const props = Object.keys(declaration) | ||||||
| const propsCount = props.length | ||||||
|
|
@@ -30,7 +30,7 @@ export default function optimizeAndDefineCssClassProps(selectorObj, cssVarDefina | |||||
| } | ||||||
| if (value === undefined || value === null) value = '' | ||||||
| let newValue = value | ||||||
| .trim() | ||||||
| ?.trim() | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The optional chaining (
Suggested change
|
||||||
| .replace(/\s{2,}/g, ' ') | ||||||
| .replace(/\\n\s*/g, '') | ||||||
| .replace(/,\s*/g, ',') | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If
validConcatSelectorsis an empty array,validConcatSelectors.join(',')will produce an empty string''. This will result in creating a CSS rule with an empty selector ('' { ... }), which is invalid and might cause issues in some CSS parsers or browsers. You should add a check to ensurevalidConcatSelectorsis not empty before joining and creating the rule.