• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mia-platform / design-system / 13071907942

31 Jan 2025 11:32AM UTC coverage: 68.605% (-29.3%) from 97.875%
13071907942

Pull #817

github

web-flow
Merge fa7bd8bdd into 174906d3a
Pull Request #817: feat(SplitButton): add onOpenChange prop

123 of 256 branches covered (48.05%)

Branch coverage included in aggregate %.

3 of 3 new or added lines in 1 file covered. (100.0%)

56 existing lines in 12 files now uncovered.

290 of 346 relevant lines covered (83.82%)

4.92 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

45.45
/src/components/ThemeProvider/utils/themeDefaultStyle.ts
1
/**
2
 * Copyright 2023 Mia srl
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *     http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 *
16
 * SPDX-License-Identifier: Apache-2.0
17
 */
18

19
import '@fontsource/inter'
2✔
20

21
import Theme from '../../../themes/schema'
22

23
/**
24
 * Default typography settings.
25
 */
26
const DEFAULT_COLOR = '#464646'
2✔
27
const DEFAULT_FONT_FAMILY = 'Inter'
2✔
28
const DEFAULT_FONT_SIZE = 14
2✔
29
const DEFAULT_FONT_WEIGHT = 400
2✔
30

31
/**
32
 * Converts a theme configuration into the theme default style applied to the DOM.
33
 *
34
 * @param {Theme} theme - The theme configuration to convert.
35
 * @returns {Record<string, string>} A record of CSS default values.
36
 */
37
export default function themeDefaultStyle(theme: Partial<Theme> = {}): Record<string, string> {
2!
UNCOV
38
  const { palette, typography } = theme
×
39

UNCOV
40
  return {
×
41
    color: palette?.common?.grey?.[700] ?? DEFAULT_COLOR,
×
42
    fontFamily: typography?.bodyS?.fontFamily ?? DEFAULT_FONT_FAMILY,
×
43
    fontSize: `${typography?.bodyS?.fontSize ?? DEFAULT_FONT_SIZE}px`,
×
44
    fontWeight: `${typography?.bodyS?.fontWeight ?? DEFAULT_FONT_WEIGHT}`,
×
45
    height: '100%',
46
    width: '100%',
47
  }
48
}
49

50
export {
51
  DEFAULT_COLOR,
2✔
52
  DEFAULT_FONT_FAMILY,
2✔
53
  DEFAULT_FONT_SIZE,
2✔
54
  DEFAULT_FONT_WEIGHT,
2✔
55
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc