You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore(theming): remove Sass default flag & update guidelines (#29458)
Remove a missed `!default` flag in the themes directory and update the
Sass variable guidelines docs to eliminate the `!default` flag from the
code examples, except for in the historic usage section which includes
examples from previous versions where the `!default` flag was used.
---------
Co-authored-by: Brandy Carney <[email protected]>
The abundance of Sass variables currently in Ionic Framework is a result of their historical usage, being used to rebuild the CSS and customize Ionic Framework components.
73
73
74
-
The comments for Sass variables are also still visible today in [v7.7.0](https://github.com/ionic-team/ionic-framework/blob/v7.7.0/core/src/components/alert/alert.ios.vars.scss), even though they are no longer used by any documentation generators:
74
+
The comments for Sass variables are also still visible today in [v8.1.0](https://github.com/ionic-team/ionic-framework/blob/v8.1.0/core/src/components/alert/alert.ios.vars.scss), even though they are no longer used by any documentation generators:
These comments aren't necessary when the naming describes its use thoroughly. The comments for the variables above do not need to be there, as it is fairly obvious what they are used for.
@@ -91,7 +91,7 @@ However, the comment for the following variable might be helpful in explaining w
91
91
// action-sheet.ios.vars.scss
92
92
93
93
///@prop - Font weight of the action sheet title when it has a sub title
It could be argued though that the comment doesn't really help, as seeing the variable in use will explain its purpose the best. Additionally, this is an example of a variable that isn't necessary, given it is only used in one place, which is why it is so specific in the first place.
@@ -110,15 +110,15 @@ We should update the comments for Sass variables in one of the following ways:
110
110
111
111
-/// @prop - Border radius of the alert
112
112
+// Border radius of the alert
113
-
$alert-ios-border-radius: 13px !default;
113
+
$alert-ios-border-radius: 13px;
114
114
```
115
115
116
116
2. If we don't find the comments to be helpful, and want to stick with keeping the variable names specific, we should remove the comments entirely:
117
117
```diff
118
118
// alert.ios.vars.scss
119
119
120
120
-/// @prop - Border radius of the alert
121
-
$alert-ios-border-radius: 13px !default;
121
+
$alert-ios-border-radius: 13px;
122
122
```
123
123
124
124
3. If we find the comments to be helpful for certain variables or situations, like when there are math calculations involved, we should keep only the comments that are necessary to explain what is going on:
@@ -133,7 +133,7 @@ We should update the comments for Sass variables in one of the following ways:
133
133
* a hairline (<1px) width, this will cause subpixel rendering
0 commit comments